1. Home
  2. Computing & Technology
  3. Java

Inheritance

By Paul Leahy, About.com

Definition:

Inheritance enables programmers to define an "is-a" relationship between a class and a more specialized version of that class. For example, if a Student class extends a Person class, then it should be the case that Student is-a Person. The subclass Student builds on the functionality of the superclass Person.

Examples:
//superclass
public class Person{

}

//subclass
public class Student extends Person{

}

The student class extends the person class and therefore inherits its state and behaviors.

Glossary:

# A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Explore Java
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Java
  4. Java Glossary
  5. I
  6. Definition for the Term: Inheritance>

©2009 About.com, a part of The New York Times Company.

All rights reserved.