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 does the “static” keyword mean?
What does super keyword do?
Can java inner class be static?
How many return statement are allowed in a function?
What is the difference between a synchronized method and a synchronized block?
Can we declare a class as static?
Are arrays immutable in java?
What are drawbacks of singleton class?
How to display all the prime numbers between 1 and 100
What are the differences between getting and load method?
Explain java heap space and garbage collection?
Explain the concept of hashtables?
What are keywords give examples?
Can static methods be inherited?
Explain access modifiers in java.