Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


Can we create instance for Abstract class?

Answers were Sorted based on User's Feedback



Can we create instance for Abstract class?..

Answer / dotnetuser

NO,

we can't create instance for abstract class

Is This Answer Correct ?    149 Yes 30 No

Can we create instance for Abstract class?..

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

Can we create instance for Abstract class?..

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

Can we create instance for Abstract class?..

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

Can we create instance for Abstract class?..

Answer / chinni

yes ,

We can but we can't create object for the abstract class

Is This Answer Correct ?    43 Yes 29 No

Can we create instance for Abstract class?..

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

Can we create instance for Abstract class?..

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

Can we create instance for Abstract class?..

Answer / thriveni

We can't create instance for Abstract class

Is This Answer Correct ?    14 Yes 6 No

Can we create instance for Abstract class?..

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

Can we create instance for Abstract class?..

Answer / bikas pandey

No.We Can't Instantiate An Abstract Class.

Is This Answer Correct ?    3 Yes 1 No

Post New Answer



More C Sharp Interview Questions

Can you allow class to be inherited, but prevent the method from being over-ridden?

1 Answers  


What are the important concepts in OOPS

5 Answers   Fulcrum Logic,


What is toint32 c#?

0 Answers  


Write a program to create a user control with name and surname as data members and login as method and also the code to call it. (Hint use event delegates) Practical Example of Passing an Events to delegates

0 Answers  


What is the usage of Enumeration in C# Programming and is it good to use or not ?

0 Answers   MCN Solutions,






What is hashtable in c# with example?

0 Answers  


Which is faster iqueryable or ienumerable?

0 Answers  


i have a table named login in mysql database containing (empid,fname,lname,mobno,emailid,usrname,usrpwd) i have 2 textboxes in which i enter my username and pwd..so based on what is entered in those textboxes it should retreive all other details of dat username in the remaining 6 textboxes..i want the code for this...

1 Answers   Royal Enfield,


What is the use of flag in c#?

0 Answers  


Why do we use anonymous method in c#?

0 Answers  


Explain manifest in c#.

0 Answers  


if a method is marked as protected internal who can access it?

0 Answers   Siebel Systems,






Categories