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 string method compareto () do?
Is string is a class in java?
what are three ways in which a thread can enter the waiting state? : Java thread
How do you make a thread in java?
Explain about anonymous inner classes ?
What is the difference between public, private, protected, and friend access?
Explain about public and private access specifiers?
what is a thread pool in java and why is it used?
Explain the pointers in Java?
What are the advantages of java over cpp?
Explain the differences between static and dynamic variables?
What is a war file?
Why is stringbuffer faster than string?
What is a variable simple definition?
What is method and methodology?