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.

Results 1 to 3 of 3

Thread: Abstract Class

  1. #1
    Junior Member
    Join Date
    Oct 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Abstract Class

    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!


  2. #2
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,235
    Thanks
    176
    Thanked 817 Times in 760 Posts
    Blog Entries
    5

  3. #3
    Member
    Join Date
    Apr 2013
    Posts
    43
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default Re: Abstract Class

    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

Similar Threads

  1. about Abstract class
    By sivarjun in forum What's Wrong With My Code?
    Replies: 2
    Last Post: December 3rd, 2012, 09:52 AM
  2. [SOLVED] Abstract method in a non-abstract class
    By bassie in forum What's Wrong With My Code?
    Replies: 2
    Last Post: December 2nd, 2012, 10:27 AM
  3. What's difference between public class and abstract class?
    By Java95 in forum Java Theory & Questions
    Replies: 7
    Last Post: January 24th, 2012, 06:37 AM
  4. abstract class
    By robinglow in forum Java Theory & Questions
    Replies: 2
    Last Post: August 20th, 2010, 01:36 AM
  5. abstract class
    By robinglow in forum AWT / Java Swing
    Replies: 2
    Last Post: August 20th, 2010, 01:36 AM