File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reading method signature

 
Abhijeet Sutar
Greenhorn
Posts: 17
Android Java Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I read this ?



though i try to read like this-
1> Method meth is taking Test class reference and retuning String class reference

2> Method meth is taking Test class object and returning String object

Just any one tell me which one correct or some other way to read

 
Mohamed Sanaulla
Saloon Keeper
Pie
Posts: 3159
33
Google App Engine Java Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abhijeet, Welcome to JavaRanch.

In java- Objects are not passed between the methods- Instead- The references, which point/refer to these objects are being passed to the method/returned from the methods. So the first version is correct (but with Strings you need to be a bit more clear)
 
Abhijeet Sutar
Greenhorn
Posts: 17
Android Java Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okay Thank you ,

But Not understood this?
Mohamed Sanaulla wrote:(but with Strings you need to be a bit more clear)

can you elaborate please ..
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohamed Sanaulla wrote:
In java- Objects are not passed between the methods- Instead- The references, which point/refer to these objects are being passed to the method/returned from the methods.


fine with one small change that The reference *copy*, which point/refer to these objects are being passed as a method argument.

@Abhijeet: to read a method signature in a class, you can go for reflection api.
 
Mohamed Sanaulla
Saloon Keeper
Pie
Posts: 3159
33
Google App Engine Java Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abhijeet Sutar wrote:
Mohamed Sanaulla wrote:(but with Strings you need to be a bit more clear)

can you elaborate please ..


You could read this: The SCJP Tip Line, Strings, Literally. You have String objects and String literals.
 
Rob Spoor
Sheriff
Pie
Posts: 20372
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Beginning Java.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic