Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Oop Concepts

Posted on 2002-04-30
3
Medium Priority
?
863 Views
Last Modified: 2013-11-23
what is Abstraction  and Encapsulation w.r.t object oriented langauges..and what is the use of implementing these concepts in programming....please explain with some good examples.??

what difference does it makes if we do use and if we do not use the above mentioned concepts in our programming..??
0
Comment
Question by:yrrm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
googlyralph earned 300 total points
ID: 6979789
Abstraction:

If you want to get from town A to town B, you would get a map. The map doesnt contain absolutly everything (every tree, blade of grass and insect on the way), but it does give you enough information about how to make your journey, ie foot paths and roads. This is abstraction, you "see" enough to do what you need to.

Encapsulation:

Think of black boxes, you cant see whats inside them (nor do oyu want/need to), you just know that by giving that black box X, then Y gets returned. This means that when somehting changes, you can change the internals of a black box, and no other code need no, beacause as long as the inputs and outputs are the same, no one will ever notice. This means that 10 people working on one project can all work on code, and as long as the design was sound, and each black box works in the way it was origianlly designed.

What difference:

The difference is that is how Java was intended to be used. And every Java programmer knows this, and so it makes it easier for several people to work on a project if you are all going about problems in a similar way. I know that at first it seems backwards and stupid, but as you go deeper into the language you start to see good reasons. When you write big system, you find that these approaches do work, so just stick with them.

GR.
0
 
LVL 35

Expert Comment

by:girionis
ID: 6979799
 Take a look at Sun's excellent tutorial on abstraction, polymorphism and encapsulation: http://java.sun.com/docs/books/tutorial/java/concepts/
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question