Results 1 to 2 of 2
Thread: Abstract Class question
- 12-17-2007, 02:44 AM #1Member
- Join Date
- Dec 2007
- Rep Power
- 01-05-2008, 10:30 PM #2
It is true that abstract classes cannot be instanced. They are used as a structure to extend from. Abstract classes can contain variables and non-abstract methods. The constructor is used to call the required methods, whether they are abstract or not, and initialize any variables. The reason that an abstract class can have a constructor is so that it's subclass can call that constructor by using the super(<arguments here>) constructor. This style of programming can significantly shorten your code.
Hope that helped. ;)Eyes dwelling into the past are blind to what lies in the future. Step carefully.
- By romina in forum New To JavaReplies: 6Last Post: 03-02-2009, 12:46 PM
- By javarishi in forum New To JavaReplies: 5Last Post: 06-15-2008, 05:43 AM
- By Santoshbk in forum Advanced JavaReplies: 0Last Post: 04-02-2008, 07:04 AM
- By gapper in forum New To JavaReplies: 4Last Post: 01-31-2008, 01:25 PM
- By osval in forum New To JavaReplies: 1Last Post: 07-25-2007, 08:36 PM