Results 1 to 13 of 13

Thread: difference between abstract class and interface

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Jan 2007
    Answers
    2

    Re: difference between abstract class and interface

    In Interface we can only declare the methods but can not implement as well as by declaring a method in Interface ,it automatically becomes abstract method.
    And we can only declare the variables but can not initialized in Interface.
    To use the methods and variables we have to implement the interface.


    In Abstract Class we can declare the abstract method as well as normal methods.Diffrence is that we can not implement the abstract method there but implement the normal methods. and abstract method will be Accessible by inherited classes...


    further any confusion then ur most welcome


  2. #2
    Junior Member
    Join Date
    Apr 2007
    Answers
    1

    Re: difference between abstract class and interface

    Interface
    Interfaces are implemented
    Interfaces cannot have constructors
    Multiple interfaces can be implemented(thereby allowing multiple inheritance)
    Interfaces can only contain abstract methods or functions
    all the members of an interface are public by default and cannot be explicitly declared so
    All the methods/functions of an interface must be impelmented


    Abstract Class

    Abstract classes are Inherited
    Only a single class can be inherited
    Abstract classes can have both abstract and contrete methods
    All the abstract members of an Abstract Class must be declared public
    All the abstract methods/functions of an Abstract class must be implemented


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