wood burning stoves*
The moose likes Beginning Java and the fly likes how to achieve abstraction in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to achieve abstraction in java" Watch "how to achieve abstraction in java" New topic
Author

how to achieve abstraction in java

Praveen palukuri
Ranch Hand

Joined: Feb 10, 2005
Posts: 65
thank u
Svend Rost
Ranch Hand

Joined: Oct 23, 2002
Posts: 904
Inheritence. Use abstract classes and interfaces.

My pleasure..

/Svend Rost
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
Create a method. That method will do something. When calling the method, you are not concerned about how the method does what it does. That's abstraction.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
There are many definitions of abstraction, but it's about ignoring certain details so you can focus on larger issues. One definition says it's not about being imprecise but finding a new language about the problem so you can be more precise.

In Java abstraction is often about referring to an abstract type - a superclass or interface - rather than a concrete type. I might make a method that refers to List:

You might call my method with an ArrayList or a LinkedList. By ignoring the detail of the exact type I can focus on the big picture of what I want to do with the list.

Does that help?


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to achieve abstraction in java