Hello guys, i am new in java. i have a question : pls tell me "what is the need of Abstract class and then Interface".
please explain this with an example. I know this is very basic question. pls help me out of this. Thanks!
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Hello guys, i am new in java. i have a question : pls tell me "what is the need of Abstract class and then Interface".
please explain this with an example. I know this is very basic question. pls help me out of this. Thanks!
A class has to be abstract if it contains abstract methods. The idea with abstract classes and methods is to force the subclasses to declare its own version of the abstract methods in the superclass. Note that it is no point to declare a method as abstract if the overiding methods in the subclasses is designed the same way as each other.
Interfaces can't contain any none-abstract methods, which abstract classes can.
A little bit messy explanation, but i hope you understand.
/Hank