Link to home
Start Free TrialLog in
Avatar of manugeek
manugeek

asked on

java function

I saw a java code snippet which was something similiar to this

Fetch.func1().func2()

I understand that Fetch is a class and func1 is method in that class, but i am not sure what is func2 is it also a method in class fetch ? and also want to when can i use this type of function call...please help

~manu

 
Avatar of a_b
a_b

Fetch.func1().func2() => Fetch is a class that has a method func1().

Fetch.func1() returns an object that has the method func2(), therefore you can invoke func2().
SOLUTION
Avatar of a_b
a_b

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Well there is no gurantee in this notation, but one may assume that Fetch is a class, func1() is a static methid of this class which returns an instance of another class, and then method func2() is invojed on the instance of the result of funnc1()
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of manugeek

ASKER

Thank @hmccurdy: for the detailed explanation. Now this makes sense to me :-)

Thanks all for the answers...
Thanks.  Never mind for the program bug that remained (oops) after I removed some lines of code that would be confusing.

I'm glad it makes sense to you now.  Gets my day off to a good start.