> What do you mean by the term Abstraction in Java?Does
> it have any relationship with Abstract Classes?How is
> encapsulation different from Abstraction?
> Thanx
> Hemansu..
Hi! Abstraction is one of the core concepts of O-O design. Abstract classes may be one of the mechanisms used while creating the design.
Encapsulation is another core concept of O-O design.
Sounds like you need to work on understanding the O-O paradigm better. May I recommend "Thinking In Java" by Bruce Eckel? You can download the electronic copy from http://www.bruceeckel.com at no charge. The first few chapters should help you understand the above two concepts.
Hope this helps!
Cheers!
No, abstraction and the "abstract" in abstract classes don't mean the same thing.
Encapsulation can be involved in abstraction, but they are not the same thing.
To understand abstraction, think about if you had to control the electrons in a computer in order to get it to do work. It would be a complete mess, trying to get quadrillions of electrons to move in the correct patterns. To solve the problem, electrical engineers use abstractions that they call transistors, build those into bigger abstractions called gates, then registers and transfer lines. The programmers then create an abstraction called machine language, then futher abstractions called high-level languages. So when you're programming Java, you're using many layers of abstraction to get the Java code to, in effect, control those pesky little electrons!
encapsulation can be termed as hiding of sensitive / important details. for example u have some sensitive data or method that u dont want other classes to access in this case u can "encapsulate" these data or methods by declaring them private. this is encapuslation simply put.
G.P.