Results 1 to 10 of 10

Thread: Real time example for abstract class and interface

  1. #1
    Geek_Guest
    Guest

    Real time example for abstract class and interface

    I know what is abstract class and interface, but i want to know the real time example where we use these both

    Question asked by visitor Bhuvaneswari


  2. #2
    Junior Member
    Join Date
    Oct 2007
    Answers
    5

    Re: Real time example for abstract class and interface

    u mean a real world or real time.Real time has a different meaning and i guess java is not used for real time applications(C/C++)


  3. #3
    Junior Member
    Join Date
    Jan 2008
    Answers
    11

    Re: Real time example for abstract class and interface

    hi,
    when ever there is need of having same common features among the subclasses of of super class we have to go for AbstractClass, when ever there is no common features for subclasses of super class we have to go for interface


  4. #4

    Re: Real time example for abstract class and interface

    the most real time example of abstract class and interface is bulding a house
    1)concrete methods are explained with completed house.
    2)abstract classes are explained with completed house but a little bit of work left
    3)interfaces are explained with taking a building plan


  5. #5
    Junior Member
    Join Date
    Mar 2009
    Answers
    6

    Re: Real time example for abstract class and interface

    Well Guys

    Don't brush in the air,I mean to know better about two key words start using/studying the codes only then you can have good picture about the strengths between the inheritance and interface.

    To feel any loveliness you should start using it. ha ha ha

    By
    Venky


  6. #6
    Junior Member
    Join Date
    Oct 2010
    Answers
    1

    Thumbs up Re: Real time example for abstract class and interface

    Quote Originally Posted by nandyalaajay2000 View Post
    the most real time example of abstract class and interface is bulding a house
    1)concrete methods are explained with completed house.
    2)abstract classes are explained with completed house but a little bit of work left
    3)interfaces are explained with taking a building plan
    Really liked your "real life" example


  7. #7
    Junior Member
    Join Date
    Nov 2010
    Answers
    5

    Re: Real time example for abstract class and interface

    When you are making a program for a real time meaning say Building; you create a class say House and then another say Shop both extend Building but you decide to make Building as an abstact class as when you create an object of the building class you don't know which kin of object it will be; will it be house or shop so the program fails and you say ah it is good that this class is made an abstract as we shouldn't create an object of this class.

    Interface is a 100 % pure Abstract class means it is a class which is 100 % abstract in nature i.e 100 % unknown what it does.


  8. #8
    Junior Member
    Join Date
    Mar 2011
    Answers
    1

    Smile Re: Real time example for abstract class and interface

    Quote Originally Posted by Puneet_Khanna View Post
    When you are making a program for a real time meaning say Building; you create a class say House and then another say Shop both extend Building but you decide to make Building as an abstact class as when you create an object of the building class you don't know which kin of object it will be; will it be house or shop so the program fails and you say ah it is good that this class is made an abstract as we shouldn't create an object of this class.

    Interface is a 100 % pure Abstract class means it is a class which is 100 % abstract in nature i.e 100 % unknown what it does.

    ok, If telephone is a class then what is a interface in it??? This ques was asked in wipro


  9. #9
    Junior Member
    Join Date
    Jun 2011
    Answers
    1

    Re: Real time example for abstract class and interface

    Quote Originally Posted by asif.shaik View Post
    ok, If telephone is a class then what is a interface in it??? This ques was asked in wipro
    Well the question asked to you was no related to Abstract Vs interface.

    Its say wat kinda inteface(methods) you will have if you have a class called TELEPHONE.
    Ans Might be:

    1.PickUpCall()
    2.dropCall()
    3.rejectCall()
    4.dialNumber()

    etc..
    Hope this cleares


  10. #10
    Junior Member
    Join Date
    May 2012
    Answers
    1

    Re: Real time example for abstract class and interface

    Quote Originally Posted by asif.shaik View Post
    ok, If telephone is a class then what is a interface in it??? This ques was asked in wipro
    If telephone is a class then its interface can be Talk. this Talk interface can b implemented by Human class as well as Telephone 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