Can we create instance for Abstract class?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how to implement an object pool in c#.net

512


What is the difference between var and dynamic types in c# 4.0?

499


i want o/p 011242110 in c# code.

1615


What is a multi line comment?

537


What is static classes in c#?

508






Which of these string definitions will prevent escaping on backslashes in c#?

559


What is the difference between dynamic and var in c#?

448


What is difference between assembly and namespace?

465


What does void do in c#?

502


What is Covariance and contravariance in C#?

547


What is command object in c#?

506


what is main function of alternate teamplate of datalist?

1628


Why do we need to call CG.SupressFinalize?

542


How do partial classes work in c#?

472


Define satellite Assembly in .NET?

549