| | |
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
| Thread Tools | Search this Thread |
-xlint add android api applet application applications array arrays automation bank bi binary blackberry bluetooth chat class client code compile compiler component database development digit eclipse equation error event fractal freeze functiontesting game gameprogramming givemetehcodez graphics gui health html hyper ide idea image infinite input int integer j2me java javame javaprojects jetbrains jni jpanel jtable julia learningresources linux list login loop main map method methods mobile myregfun netbeans newbie nonstatic notdisplaying pearl problem program programming project qt recursion scanner screen scrollbar server set sms sort sorting spamblocker sql sqlserver string superclass swing system text-file thread threads tree variablebinding windows xor






