Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

simple instantiation from Mughal book  RSS feed

 
Jarrod Legion
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
The code below contains two classes, and an inerface. In class Planet, shouldn't the Star object orbiting be instantiated before it can use the method describe()? Without instantiating the Star class it compiles, but gives a NullpointerException, as it should, during execution. Can someone please tell me if I am right?
Mughal keeps a nice Errata page, but this isn't on it, so I am curious as why it isn't.


TIA,
-Jarrod
 
Yosi Hendarsjah
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're right.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!