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
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
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank @hmccurdy: for the detailed explanation. Now this makes sense to me :-)
ASKER
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.
I'm glad it makes sense to you now. Gets my day off to a good start.
Fetch.func1() returns an object that has the method func2(), therefore you can invoke func2().