943,866 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 1329
  • Java RSS
Oct 6th, 2007
0

abstract class

Expand Post »
in abstract class the methods may or may not be implemented, when we implement the methods in the abstract class, then why cant we instantiate objects in for the abstract class. is it mandatory that the objects are not instantiated in abstract class. can anyone tell me the internal working of the abstract class.
Similar Threads
Reputation Points: 37
Solved Threads: 0
Newbie Poster
tinamary is offline Offline
16 posts
since May 2007
Oct 6th, 2007
0

Re: abstract class

If even one method is declared as abstract then the class must be abstract and cannot be directly instantiated. There may be a lot of other functionality in the class, but declaring a method abstract means "this behavior must be specified by a subclass". To instantiate, you must at the very least implement the methods that are declared as abstract in a subclass and thus provide that "missing" behavior of the method. Abstract classes let you code a lot of common functionality into a base class and leave only the specific differences in implementation to be supplied.
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 839
Posting Genius
Ezzaral is offline Offline
6,761 posts
since May 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Running Java Program outside an IDE
Next Thread in Java Forum Timeline: chat client in java





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC