Can we inherit the constructor in a Class?please give one
example.

Answer Posted / brijendra kumar(java xavient)

We connot inherit the constructor in class beause the
construtor name is same as the class name.

class Brijendra
{
int x,y;
Brijendra(int a , int b) //constructor of class
{
a=x;
b=y;
}
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If a class is declared without any access modifiers, where can the class be accessed?

591


What is a short in java?

496


What is singleton class and how can we make a class singleton?

659


Why collection doesn’t extend cloneable and serializable interfaces?

638


How many bits is a string in java?

577






What is the main functionality of the remote reference layer?

1409


Is null a value?

558


What is string [] java?

524


Why do we create public static method in java?

577


What is the purpose of the main method?

538


What is ++ a in java?

566


What is the use of bufferedreader?

528


What is arraylist e?

557


Explain, java is compatible with all servers but not all browsers?

604


What are the differences between Java 1.0 and Java 2.0?

1675