Skip to main content

Abstract & Interface Concept

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
umesh_rama
Offline
Joined: 2008-11-21

Hi,

Could you please explain the scenario.
when we have to use Abstract class & Interface?.

I have a big confusion regarding Abstract class & Interface

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rahulyadavans
Offline
Joined: 2013-08-30

Hi umesh_rama..

Abstract class-" hiding implementation detail and showing essential features only."

For example-

you have a mobile. You know how to use mobile mean how to call some one n how to msg someone, etc. but you don't care about internal process behind the calling, msg etc. that means the mobile showing only feature that you have to know.

Interface- "Interface just like a class. It is a contract for a class that implement it."

For example-
Car is an interface. It defines specification like four wheels, one engine, etc. for every car.

I think it could help. If you have any query please reply me...