| | |
abstract class
![]() |
•
•
Join Date: May 2007
Posts: 16
Reputation:
Solved Threads: 0
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.
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.
![]() |
Similar Threads
- need of abstract class (Java)
- problem with an abstract class (C#)
- problem instantiating a subclass of abstract class (C)
- What is the difference between abstract class and interface (Java)
Other Threads in the Java Forum
- Previous Thread: Paint Application In Java
- Next Thread: chat client in java
Views: 1232 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Java
access add android applet arguments array arrays binary bluetooth c++ chat class classes client code compiler component constructor convert converter coordinates data database design eclipse error event exception fast file filei/o forloop givemetehcodez graphics gridlayout gui helpwithhomework homeworkassignment ide image images input integer j2me java jframe jmf jpanel jtable jtextarea julia key lazy linked linked-list list loop looping main method methods mobile netbeans newbie number object objects oracle os output page pattern print problem programming read recursion regex remove return robot scanner screen server set size sms software sql string swing text text-file thread timer translate tree user web windows






