Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

K&B doubt

 
Abdul Mohsin
Ranch Hand
Posts: 111
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In page no 45 2nd para , it is written as
"Finally you need to know that the abstract modifier can never be combined with the static modifier."

But we can apply both abstract and static in the same time in inner classes.

Need your opinion

Regards,

Abdul Mohsin
 
Faisal Ahmad
Ranch Hand
Posts: 355
Chrome Java Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello AbdulMohsin,
Please check the para again - its for methods!
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Need to make a class abstract and static:

Suppose you have only static methods in your class, so it is meaningless
to create instance of the class to access the methods. So we can make that
class (nested class of course) abstract. We can extend the nested class
as well access the members of it without need of instance of that class.




Thanks,
 
Abdul Mohsin
Ranch Hand
Posts: 111
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks faisal and chandra for prompt reply
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic