File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes abstract class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "abstract class" Watch "abstract class" New topic

abstract class

Arulmariappan Ramasamy

Joined: Mar 06, 2011
Posts: 7
explain about abstract class and interface
sourabh girdhar
Ranch Hand

Joined: Feb 10, 2010
Posts: 71

This is most common interview question. Not something you will like to post as new thread.

Search through Java ranch forum or simple Google and you will get the detailed explanation about difference between interface and abstract class.

The significant problems we face cannot be solved by the same level of thinking that created them -- Albert Einstein

Javin Paul
Ranch Hand

Joined: Oct 15, 2010
Posts: 295

Check it here , you may find it useful Abstraction in Java

SQL Query Interview Question java67 Javarevisited
Christian Joseph
Ranch Hand

Joined: Jan 07, 2011
Posts: 43
for meaning just use Google or Yahoo..

but for the difference(i know theres many difference but imo the important ones are)

Interface has a default public abstract (methods).. and default public static final instance variable.. (when i say default it only means it automatically has that)

while Abstract can be Abstract or concrete members(methods) ..

thats all i know
Sanjeev Ba
Ranch Hand

Joined: Dec 31, 2006
Posts: 40

I think the question scope is very broad. Better to refer to books.

A few things come to mind.

1. Interface can "extend" only interfaces.

2. Abstract classes can extend only one other abstract class and can implement multiple interfaces.

3. Abstract classes can provide implementations of some or all methods.

4. All interface methods are implicitly public and abstract.

And many more.

I agree. Here's the link:
subject: abstract class
It's not a secret anymore!