Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFSJ book doubt?

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

In the HFSJ book, on page 352, they have given 2 classes with one as the abstract class and the other concrete class and they have shown both to be in the same package. So is this legal as they have declared both classes to be public?? A package can have only one public class! Am I right??
 
Amirr Rafique
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jothi

There is no restriction like
A package can have only one public class
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A package can have more than one public class whereas a java file can have no more than one public class.
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for clarifying!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic