Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reading method signature

 
Abhijeet Sutar
Greenhorn
Posts: 17
Android Java Tomcat Server
  • 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
Posts: 3159
33
Google App Engine Java Ruby
  • 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
  • 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
  • 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
Posts: 3159
33
Google App Engine Java Ruby
  • 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: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Beginning Java.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic