• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

reading method signature

 
Greenhorn
Posts: 17
Android Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ..
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to Beginning Java.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic