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 finally block?

555


If a method is declared as protected, where may the method be accessed in java programming?

483


Explain java coding standards for variables ?

655


Is string a class in java?

497


What do you understand by the bean persistent property?

539






What are internal and external variables?

532


What is javac_g?

580


What is exception in java?

556


What are 4 pillers of object orinted programming?

570


What is the dot operator?

559


what is mena by object block any what is the use of that

1753


What is defined as false sharing in the context of multithreading?

494


What is tcp and udp?

585


What is the difference between yield() and sleep()?

531


What is difference between add() and addelement() in vector?

1052