my dog learned polymorphism*
The moose likes Beginning Java and the fly likes Abstract Class Instance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Abstract Class Instance" Watch "Abstract Class Instance" New topic

Abstract Class Instance

Dean Jones

Joined: Jun 18, 2002
Posts: 24
can any one of u tell me
is there any way to have the instance of the abstract class.
i dont think so but i was asked this in an interview so there might be...........
Dean Jones
Mohan Panigrahi
Ranch Hand

Joined: Sep 28, 2001
Posts: 142
Hi Dean,
Ofcourse you cannot instantiate an abstract class. But you can use the implementation of an abstract class by extending it.
Here is the code :
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
Right. There is no way to instantiate an abstract class. You can have an identifier of the abstract class type, of course.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
wood burning stoves
subject: Abstract Class Instance
Similar Threads
Use of constructor in abstract class?
abstract class
abstact private
Confusion in Calender Class
Abstract Class concept