aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Access Modifiers pg 26 k&b book(doubt) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Access Modifiers pg 26 k&b book(doubt)" Watch "Access Modifiers pg 26 k&b book(doubt)" New topic
Author

Access Modifiers pg 26 k&b book(doubt)

aslika bahini
Ranch Hand

Joined: Mar 03, 2007
Posts: 111


output:

Moo says...wow baby
zoo says...wow baby


when I try to invoke the coolMethod() using Moo instance(Moo m = new
Moo()) (i.e) m.coolMethod() in the line #1. it's not called bcoz of
run time i guess...but when i invoke inside useMyCoolMethod() of the
Moo class. it's got invoked.(which is also invoked by the same
instance Moo i guess..)

may I know what is wrong with my understanding..

Thanks in Advance
regards
samura







marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Please use real words (like "because" rather than "bcoz"). Thanks!


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Fedry Kemilau
Ranch Hand

Joined: Aug 06, 2007
Posts: 44
while m.coolMethod() is invoked, it is returning String. So you should assign it to variable, or print it directly.

Example: System.out.println(m.coolMethod());


Solve this code:<br /> <br />10010101100001111011011000010100000111001011011111100011110101111100110100001
aslika bahini
Ranch Hand

Joined: Mar 03, 2007
Posts: 111

Thanks fedry! I didn't realize that...


regards
samura
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Access Modifiers pg 26 k&b book(doubt)