Encapsulation « Class « Java Articles

Home
Java Articles
1.Build Deploy
2.Class
3.Core Library
4.Data Types
5.Database JDBC
6.Design
7.Development
8.File Input Output
9.Graphics Desktop
10.J2EE Enterprise
11.J2ME Wireless
12.JVM
13.Language
14.Library Product
15.Network
16.Security
17.SOA Web Services
18.Test
19.Web Development
20.XML
Java Articles » Class » Encapsulation 

1. Encapsulation is not information hiding    javaworld.com

In this article, I explore the distinction between encapsulation and information hiding through the development of example code. The discussion shows how Java facilitates encapsulation and investigates the negative ramifications of encapsulation without data hiding. The examples also show how to improve class design through the principle of information hiding.

2. Packaging Objects to Preserve Encapsulation    developer.com

In this example we created 3 classes, Mammal, Dog, and an application class called Packaging. The reason that we named the application Packaging was due to the fact that we are going to address our encapsulation/inheritance dilemma by using Java packaging. The Mammal class is shown in listing 1.

3. The Essence of OOP Using Java, Objects, and Encapsulation    developer.com

A description of an object-oriented program will be provided, along with a description of an object, and how it relates to encapsulation.

4. Exploring Encapsulation    developer.com

Now that we have covered the conceptual basics of classes and objects, we can start to explore specific concepts in more detail. Remember that there are three criteria that are applied to object-oriented languages: They have to implement encapsulation, inheritance, and polymorphism. Of course, these are not the only important terms, but they are a great place to start a discussion.

5. Encapsulation vs. Inheritance    developer.com

Peter Coad and Mark Mayfield make a case that, when using inheritance, encapsulation is inherently weakened within a class hierarchy. They discuss a specific risk: Inheritance indicates strong encapsulation with other classes, but weak encapsulation between a superclass and its subclasses.

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.