It's not a secret anymore!
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 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]
I agree. Here's the link:
subject: Abstract Class Instance
jQuery in Action, 3rd edition