The Artima Developer Community
Sponsored Link

Java Buzz Forum
Java 101 primer: Composition and inheritance

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
News Manager

Posts: 47623
Nickname: newsman
Registered: Apr, 2003

News Manager is the force behind the news at Artima.com.
Java 101 primer: Composition and inheritance Posted: Oct 22, 2015 7:30 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by News Manager.
Original Post: Java 101 primer: Composition and inheritance
Feed Title: JavaWorld
Feed URL: http://www.javaworld.com/index.rss
Feed Description: JavaWorld.com: Fueling Innovation
Latest Java Buzz Posts
Latest Java Buzz Posts by News Manager
Latest Posts From JavaWorld

Advertisement

In "Java 101: Inheritance in Java, Part 1," you learned how to leverage inheritance for code reuse, by establishing is-a relationships between classes. This free Java 101 primer focuses on composition, a closely related programming technique that is used to establish has-a relationships instead. Whereas inheritance extends the features of one class to another, composition allows us to compose a class from another class. The distinction may seem subtle, but it will make more sense once you see it in code.

To read this article in full or to leave a comment, please click here

(Insider Story)

Read: Java 101 primer: Composition and inheritance

Topic: Scala extractors infix sample with Rational numbers Previous Topic   Next Topic Topic: Basics of scaling Java EE applications

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use