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 replacefirst in java?
Can a main method be overloaded?
What happens when a thrown exception is not handled?
Hi i am creating desktop application in that i want calling to mobile number. i have java telephone api (JTAPI) but i dont understand how it configure & use plese help me
When throws keyword is used?
What is downcasting?
What is the use of put method?
Can java list be null?
Does collectionutils isempty check for null?
What is main in java?
Why is it important to initialize a variable?
What is array initialization in java?
Can we execute a program without main?
What is hash in java?
Does importing a package imports its sub-packages as well in java?