• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java method calling

 
camey bensingh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the meaning of the following code,

Classname.MethodName1().MethodName2();

Pls any one explain.
 
Laxmikant Ruikar
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by camey camey:
What is the meaning of the following code,

Classname.MethodName1().MethodName2();

Pls any one explain.


Classname.MethodName1() represent one object of class, and you are invoking MethodName2() method on it.
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi "camey camey", Welcome to Javaranch,

seems like your name does not follow the Javaranch naming policy please change it here
Also please have a glance through the Ask Good Questions link below.
Thank you
[ April 18, 2008: Message edited by: Amit Ghorpade ]
 
Campbell Ritchie
Sheriff
Pie
Posts: 49379
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Laxmikant Ruikar:
Classname.MethodName1() represent one object of class, and you are invoking MethodName2() method on it.
I think this needs a beginner's explanation; it is really a beginner's question.

  • If you start with Classname, then you are invoking its static method1
  • This method1 returns something which has a method called method2.
  • You are calling method2 on whatever that is.
  • Whoever coded that ought to have provided links in the Javadoc comments for whichever class it is to explain what its method1 returns.
  • Whoever coded that class should have given an explanation about what method2 does.
  • And Amit Ghorpade is right about displayed names.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic