aspose file tools*
The moose likes Beginning Java and the fly likes reading method signature Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "reading method signature " Watch "reading method signature " New topic
Author

reading method signature

Abhijeet Sutar
Greenhorn

Joined: Feb 28, 2010
Posts: 17

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


OCPJP 6 93%
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

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)

Mohamed Sanaulla | My Blog
Abhijeet Sutar
Greenhorn

Joined: Feb 28, 2010
Posts: 17

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

Joined: Jan 28, 2008
Posts: 5575

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

Joined: Sep 08, 2007
Posts: 3071
    
  33

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

Joined: Oct 27, 2005
Posts: 19696
    
  20

Moving to Beginning Java.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: reading method signature