Can you have a constructor in abstract class?
Answer Posted / suresh
any class which extends with an object class should have a
constructor whether a class is abstract class or not.
if a abstract class is super class to some sub classes,
then the abstract class should extneds with oject class.
EX: abstract class A{
A{
super(); /// it ll give a call to super class
/// super() we can use only in
constructor
}
}
class B extends A{
}
means any class should extnd with super class.
because of this abstract classes are not 100% abstract.
interface is 100% abstract.
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is void in java?
Does constructor return any value?
What is the difference between a method and a procedure?
what is the constructor and how many types of constructors are used in java?
What is thread safe singleton?
What are the important methods of java exception class?
What is the driver class?
What is t in generics in java?
How many bits is a 64 bit byte?
Can we declare register variable as global?
Difference between arraylist and vector.
How do I write a self declaration?
What are the different types of inner classes?
How do you achieve polymorphism in java?
Hi Anyone know the model / questions of the Federal bank sample questions for the post of Specialist Officers - Programmers. Please post if anyone have..