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 the difference between conversation & casting?
How does hashset works in java?
What is binary search in java?
What is a ternary operator in java?
Can java program run without jre?
What is sorting in java?
Explain about procedural programming language or structured programming language and its features?
What is bytecode verifier?
Is double bigger than float?
Define immutable object?
Can constructor be static or final?
What is singleton class example?
What is the symbol for average?
can any body body expalin best definitions & best real time exaples for opps concepts.
What is use of inner class in java?