Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Java Tutorial - Inheritance and Polymorphism

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
6,021
Google+
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Dec 12, 2010

Inheritance and Polymorphism are explained with real examples. Deep dive in to Java classes to understand these concepts. All programs are available at www.JavaTutorial.tv.

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 1 dislikes

Link to this comment:

Share to:

Uploader Comments (JavaTutorialTV)

  • Also can you also explain, what this statement stand for:

    for (Person person : persons)

    ______________________

    thanks

  • @deprosun

    for (Person person: persons) means 'for each person in person collection (or array)'. It is called enhanced for loop. Please see my video on enhanced for loop for details (I will attach it to this vid)

  • thank you so much for this tutorial. I have a question! can we override a method in a subclass1 in subclass2 ? And i mean, when subclass1 is not overriding any method from super-class.

  • @deprosun, sure you can override that method.

  • rabtive, I am glad you found it helpful. Current example has Person extended by Professor. Instead we can have Person extended by Employee and the Employee is extended by Professor. In terms of complexity, Person can have address, gender, age and other things. Employee can have attributes startDate, position, salary, attendance and operations like calculateSalary() and promotion(). The professor can have attributes qualification, classes taught and operations like teach, gradeStudents.

see all

All Comments (12)

Sign In or Sign Up now to post a comment!
  • Very clear explanation, thank you so much.

  • I will have an exam tmr about JAVA !!

    and you just saved my life thanks !

  • The best ever java tutorials! your emphasize on every word is very meanful.-Thank you-

  • the best tutorial i have found.

    thanks a lot

  • Thank you very much for this tutorial.Very helpful. Could you please give an example in which there are two or three levels of inheritances with more sophisticated functions?

    Many thanks

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more