Java 101: Inheritance in Java, Part 2

Java provides a standard class library consisting of thousands of classes and other reference types. Despite the disparity in their capabilities, these types form one massive inheritance hierarchy by directly or indirectly extending the Object class. This is also true for any classes and other reference types that you create.

In the first half of this miniseries on inheritance you learned the basics of inheritance, specifically how to use the extends and super keywords to derive a child class from a parent class, invoke parent class constructors and methods, override methods, and more. Now we’ll turn our focus to the mothership of the Java class inheritance hierarchy, java.lang.Object. Studying Object and its methods will help you gain a more functional understanding of inheritance and how it works in your Java programs. Being familiar with those methods will help you make more sense of Java programs, generally.

To read this article in full, please click here

分類: IT 資訊科技 趣聞, IT 資訊科技(信息技术), java教學網站, 科技趣聞,標籤: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 。這篇內容的永久連結