Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

abstract / non abstract class

 
frantisek nejedly
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is an abstract class and I only remove the keyword abstract.
Is the class functionality the same as before except for ability to be instantiated? Or is there anything more?
Thank you.
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by frantisek nejedly:
There is an abstract class and I only remove the keyword abstract.
Is the class functionality the same as before except for ability to be instantiated? Or is there anything more?
Thank you.


Assuming there were no abstract methods in the class then the functionality will not have changed.
If there were abstract methods then you will need to implement these and by implementing them you are obviously changing the functionality.
 
chander shivdasani
Ranch Hand
Posts: 206
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If there are no abstract methods in the class, then you will be able to instantiate the Class.

If the class contains even one abstract method then the class needs to be marked as abstract otherwise it wont compile.
 
frantisek nejedly
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I know this. Thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic