Can we create instance for Abstract class?
Answers were Sorted based on User's Feedback
Answer / dotnetuser
NO,
we can't create instance for abstract class
| Is This Answer Correct ? | 149 Yes | 30 No |
Answer / ahmadjad
no instance for Abstract Class,not support
multiinhertance,you can inherit abstract class and override
the abstract function in abstract class
| Is This Answer Correct ? | 34 Yes | 8 No |
Answer / sudhakarramineni
Yes, but it is not recommended to create an instance
directly for abstract class, it may causes to crash the JVM.
First one thing you want to know is Abstraction. Hiding
unnecessary details to the user and expose the details which
are required to the end user is called abstraction.
Eg: In telephone, dialing a number is an interface and
complex circuit which takes keystrokes of a user and
performs the necessary operation is called it's implementation.
Generally, humans manage complexity through abstraction.
So any complex device can be operated by abstraction, even
though they don't know it's implementation.
Abstract class contains abstract methods and concrete
methods. A method without body is called abstract method
otherwise it 'll be treated as general method.
Solution:
If you want to create an instance for abstract class,
first you create a concrete subclass and create an instance
for that and use it.
| Is This Answer Correct ? | 37 Yes | 13 No |
Answer / madhu
no,we cannot create instance for abstract class but we can
create reference for abstract class.A reference doesnot
contain its own memory like object when it is created, but
shares the memory of the class.
we can create an object for derived class.we can use
this object to call the methods.
| Is This Answer Correct ? | 27 Yes | 6 No |
Answer / chinni
yes ,
We can but we can't create object for the abstract class
| Is This Answer Correct ? | 43 Yes | 29 No |
Answer / nitin kumar
NO, Bcoz Abstract is a class that cannot be instantiated
that must be inherited and it is designed to act as a base
class for other classes
| Is This Answer Correct ? | 15 Yes | 5 No |
Answer / siddarth
Abstract class means pure Method with out definition.so we
cant create instance for that
| Is This Answer Correct ? | 50 Yes | 42 No |
Answer / manjit
abstract class aa {
public abstract void main(String[] args);
}
class aaa {
public static void main(String[] args)throws Exception{
Object x = Class.forName("aaa").newInstance();
System.out.println(x);
}
}
Try the above program and be amazed and shocked!
| Is This Answer Correct ? | 6 Yes | 3 No |
Answer / bikas pandey
No.We Can't Instantiate An Abstract Class.
| Is This Answer Correct ? | 3 Yes | 1 No |
what is the syntax to inherit from a class in c#?
What to implement on my class Finalize or IDisposable
Is friend a constructor?
Is learning c# hard?
If a class derives from another class, will the derived class automatically contain all the public, protected, and internal members of the base class?
What is datasource c#?
What is c# entity framework?
What are properties in C#?
How long can a string be c#?
What does virtual keyword mean ?
Assembly Code. in Rejester AL. How do Contast Replece( or Change): Bit D3 With Bit D4 and Bit D2 With Bit D5 and Bit D1 With Bit D6 and Bit D0 With Bit D7 I am Not Know Very Well Write English.
What is firstordefault c#?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)