Can you have a constructor in abstract class?

Answer Posted / sadiq

Yes. Abstract class can have constructor.
But abstract class cannot be instantiated,how we can call
constructor? Using super()(calls super class constructor) in
the subclass which extends abstract class.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between static and final?

759


Can we compare two strings in java?

762


How many types of literals are there in JAVA?

774


What do you understand by an io stream?

793


What is the lifetime and scope of a variable?

747


What is an object's lock and which object's have locks in java programming?

769


Can a abstract class be defined without any abstract methods?

782


How will you reverse a singly-link list?

774


What is bitwise complement?

718


What is a newline character in java?

779


Where pragma is used?

822


How to pass arraylist to stored procedure in java?

758


What is the final field modifier?

747


State two differences between C and Java.

941


What is string [] java?

731