my dog learned polymorphism
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

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

Joined: Jul 22, 2000
Posts: 9056
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.

"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
I agree. Here's the link:
subject: how to achieve abstraction in java
It's not a secret anymore!