Can we create instance for Abstract class?
Answer Posted / 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 |
Post New Answer View All Answers
Major difference between Basic httpbinding and WShttpbinding?
What is the usage of transponders?
Hi to all..I have to create an intranet application on C#.NET windows Application so please please let can you people help me as iam new in .NET and if u have any samples or website address from where i can get sample please let know.
Why is dll used?
Which types of inheritances does c# support?
What is a dll in c#?
In a single .NET DLL how many classes it contains?
What is the reason behind the invention of c#?
What is the default value of singleordefault?
What is the namespace for datatable in c#?
Can you prevent a class from being instantiated?
What is hashmap in c#?
What is the use of oops in c#?
What are different types of Delegates in C#?
What is strong data type in c#?