Solved

Oop Concepts

Posted on 2002-04-30
3
851 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 75 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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

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…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

688 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