Solved

Oop Concepts

Posted on 2002-04-30
3
822 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
3 Comments
 
LVL 2

Expert Comment

by:CSuvendra
ID: 6979731
0
 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now