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


Please Help Members By Posting Answers For Below Questions

What is replacefirst in java?

748


Can a main method be overloaded?

756


What happens when a thrown exception is not handled?

758


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

1559


When throws keyword is used?

744






What is downcasting?

774


What is the use of put method?

705


Can java list be null?

733


Does collectionutils isempty check for null?

1094


What is main in java?

753


Why is it important to initialize a variable?

709


What is array initialization in java?

679


Can we execute a program without main?

716


What is hash in java?

683


Does importing a package imports its sub-packages as well in java?

726