File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes HF : method before name Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "HF : method before name" Watch "HF : method before name" New topic
Author

HF : method before name

patrick van merchtn
Greenhorn

Joined: Apr 04, 2007
Posts: 9
Hi, in my book Head First p. 62

You've got the creation of an object.



a few lines futher in this class you've got the method


My question is, it seems that he call first the method and later set a nanme. Is this ok in java, to add the name to the instance variable after you invoke the method where you need this name ?
patrick van merchtn
Greenhorn

Joined: Apr 04, 2007
Posts: 9
sorry, I see it. Of course the first time when he invoke the method there is no name assigned to the variable and the result is :
null hello.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: HF : method before name
 
Similar Threads
Java head: object references variables
Head First Java Dog Example
can someone explain to me why the output would say null?
Where is this line coming from??
Learning about objects