Can you have a constructor in abstract class?
Answer Posted / sam
Yes
abstract class test{
int i=10;
abstract void method();
test(){
System.out.println("Abstract class constructor");
}
}
public class test1 extends test{
void method(){
//implement abstract method of test
}
public static void main(String args[]){
test1 t=new test1();
}
}
| Is This Answer Correct ? | 29 Yes | 2 No |
Post New Answer View All Answers
What is a type parameter in java?
List the different types of classloaders in java.
What causes memory leak in java?
State one difference between a template class and class template.
Explain importance of inheritance in java?
What is the importance of main method in Java?
What do you mean by a JVM?
What is the benefit of abstract class?
What is a variable analysis?
What are the two types of exceptions in java? Which are the differences between them?
What data structures are used to perform recursion?
How does hashset work in java?
What are the steps that are followed when two computers connect through tcp?
Difference between method overloading and overriding.
What is a Hash Table? What are the advantages of using a hash table?