Results 1 to 8 of 8

Thread: Diff B/W Interface & Abstract class

  1. #1
    Junior Member
    Join Date
    Feb 2008
    Answers
    6

    Smile Diff B/W Interface & Abstract class

    Hi frnds,

    Can any body solve my qustion,

    In Interface containing abstract methods right......
    and
    Abstract class also containing abstract methods right....

    so both are using abstract methods.

    Then why Interface or Abstract class ?????? what's the diff

    Let me know at least 3 resons plz...



    Thanks & Regards,

    Sreekanth S.

    Last edited by sforsree; 02-25-2008 at 03:45 AM.

  2. #2

    Re: Diff B/W Interface & Abstract class

    Diff B\w Interface And abstract Class:

    1.Abstract class contains abstract method but interface did't contains abstact method

    2.modifier for abstact class can be public and internal
    for interface modifier can be public and abstacr

    3.it's an incompleate class but interface is not a class it is treated as class
    for abstact class keyword abstact is used but for inteface , keyword interface is used .

    i think so it will be helpful for u .

    thanks
    G.S.Rathore


  3. #3
    Junior Member
    Join Date
    Feb 2008
    Answers
    6

    Re: Diff B/W Interface & Abstract class

    Hi Rathore,

    Thanks for your give advise. But I have one doubt,

    when you says interface did't contains abstract method , but in Interface by default all methods are public abstract. Is it right or wrong.

    plz solve this doubt.

    Thanks & Regards,
    Sreekanth S


    Quote Originally Posted by gyanrathore3438 View Post
    Diff B\w Interface And abstract Class:

    1.Abstract class contains abstract method but interface did't contains abstact method

    2.modifier for abstact class can be public and internal
    for interface modifier can be public and abstacr

    3.it's an incompleate class but interface is not a class it is treated as class
    for abstact class keyword abstact is used but for inteface , keyword interface is used .

    i think so it will be helpful for u .

    thanks
    G.S.Rathore



  4. #4
    Junior Member
    Join Date
    Jun 2008
    Answers
    1

    Re: Diff B/W Interface & Abstract class

    you can define the body of abstract method in abstract class but u cannot define the body of method in interface.


  5. #5
    Junior Member
    Join Date
    Mar 2008
    Answers
    1

    Re: Diff B/W Interface & Abstract class

    In abstract class there is no necessity that, all the methods should be abstract. there can be both abstract and concrete methods.

    But in interface all the methods are abstract. No method should be concrete.


  6. #6
    Junior Member
    Join Date
    Jul 2007
    Answers
    3

    Re: Diff B/W Interface & Abstract class

    Hi Sree,

    Abstract class and interfaces are completely different.

    1) In an abstract class, you may also have some concrete methods( fully implemented. It can have all its methods as concrete, yet be declared as abstract) , but in an interface, all the methods ought to be abstract.

    2)Abstarct class can never be instantiated, but you can indirectly instantiate an interface by instantiating the class which implements it and then use the its methods.


  7. #7
    Junior Member
    Join Date
    May 2008
    Answers
    1

    Re: Diff B/W Interface & Abstract class

    need study guide for weblogic?beginning learners


  8. #8
    Junior Member
    Join Date
    Sep 2008
    Answers
    1

    Re: Diff B/W Interface & Abstract class

    Abstract classes are intended to be used base class. An abstract class cannot be instantiated.
    A non-abstract class derived from an abstract class must include actual implementations of all inherited abstract methods and accessors.
    Abstract and sealed (class cannot be inherited) modifier can’t work together.

    An abstract class can have abstract members as well non-abstract members. But in an interface all the members are implicitly abstract and all the members of the interface must override to its derived class.

    Abstract classes can have protected members, static members.
    The members of the interface are public with no implementation

    An interface can inherit from one or more base interfaces.
    A class can inherit one or more interfaces, but only one abstract class.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact