Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

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 a subsequence of a string?

172


What is number data type in java?

191


What is the advantage of preparedstatement over statement?

199


What is string [] java?

190


How do you declare a string variable?

180






What is the set interface in java programming?

210


What are the different ways of creating thread?

216


How to perform linear search in java?

205


What is the difference between throw and throws in java?

194


What is the use of :: in java?

232


What is cr keyboard?

183


extending thread class or implementing runnable interface. Which is better? : Java thread

197


What are aggregate functions explain with examples?

165


What is Java Annotations?

252


What is difference between module and function?

175