IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
Java
Search Java Group:

Advanced
-Collapse +Expand Java To/From
To/FromCODEGuides
-Collapse +Expand Java Store
PRESTWOODSTORE

Prestwood eMagazine

October Edition
Subscribe now! It's Free!
Enter your email:

   ► KBProgrammingJavaStandard JavaLanguage Det...   Print This     
  From the January 2016 Issue of Prestwood eMag
 
Java Language Details:
Java Inheritance (extends ParentClass)
 
Posted 16 years ago on 10/23/2008 and updated 1/29/2009
Java Code Snippet:
 A flashcard from our Java Flashcards Library
 A code snippet from our Java Code Snippets Page
 Tags: Java , Inheritance

KB101392

General Info: Inheritance

The concept of a class makes it possible to define subclasses that share some or all of the main class characteristics. This is called inheritance. Inheritance also allows you to reuse code more efficiently. In a class tree, inheritance is used to design classes vertically. (You can use Interfaces to design classes horizontally within a class tree.) With inheritance, you are defining an "is-a" relationship (i.e. a chow is-a dog). Analysts using UML call this generalization where you generalize specific classes into general parent classes.

Java Inheritance

Simple syntax example of class inheritance.

Syntax Example:

In the following example, a terminator T-600 is-an android. 

public class Android {
}
 
public class T-600 extends Android {
}

Class Scope Specifiers

Private, Protected, and Public Members

In most OOP languages, private, protected, and public members have a specific scope:

  • Private = Used by the defining class only. Invisible outside of the class except by friendly classes.
  • Protected = Used by the defining class and descendant classes only (plus friendly classes).
  • Public = Visible wherever its class can be referenced.

More Info

Definition:  Inheritance

Comments

1 Comments.
Share a thought or comment...
First Comment
Comment 1 of 6

I began late and passed eventually your blog Escorts Frankfurt Agency and have been analyzing along. I figured I would leave my first remark.

Posted 39 months ago

Comment 2 of 6

เกมสล็อตออนไลน์รูปแบบใหม่ที่แจกโบนัส เครดิตฟรีให้กับคุณมากที่สุดและยังเป็นแหล่งรวมสล็อตแตกง่ายยิ่งฝากเยอะ ยิ่งได้รับเยอะ เพียงแค่คุณพร้อมเข้ามาร่วมสนุกกับเราได้ที่หน้าเว็บไซต์ MEGAGAME.LIFE

Posted 29 months ago

Comment 3 of 6

There are many online games that entertain us very well. I usually play bubble shooter after every hour of work. This is an extremely interesting ball shooting game and suitable for all ages

Posted 23 months ago

Comment 4 of 6
I am no expert, but I believe you just made an excellent point. You certainly fully understand what youre speaking about, and I can truly get behind that. If you want to have a fun time for free, play this basketball legends unblocked game. If you want, you can play single player or multiplayer. You should try this game for a fierce competition.
Posted 23 months ago

Comment 5 of 6
This is very educational content and written well for a change. It‘s nice to see that some people still understand how to write a quality post! I would also like you to try this very popular game. This game basketrandom.org is really fun, you don‘t understand how time passes.
Posted 23 months ago

Latest Comment
Comment 6 of 6

Embrace the ease and assurance it brings to your travels, joining a community that has found their ultimate guide to seamless navigation and confident exploration. Use mapquest driving directions now.

Posted 14 months ago
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P161A1
Enter key:
Code Contributed By Mike Prestwood:

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Visit Profile

 KB Article #101392 Counter
15807
Since 10/23/2008
Sales Website: www.prestwood.com Or visit our legacy sales site: 
legacy.prestwood.com


©1995-2024 Prestwood IT Solutions.   [Security & Privacy]