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

What do you mean by multithreaded program?

790


Why generics are used in java?

808


Why java is not 100% object-oriented?

1220


What is the use of a copy constructor?

806


What is a two-pass assembler?

835


What is getclass () getname () in java?

917


What is the purpose of using bufferedinputstream and bufferedoutputstream classes?

847


What is an off by one error in java?

755


Is minecraft java edition free?

890


What is a method in coding?

830


What is the difference between reader/writer and inputstream/output stream?

814


What is the purpose of declaring a variable as final?

758


Give differences between Quicksort & Mergesort. When should these sorts be used and what is their running time?

808


a thread is runnable, how does that work? : Java thread

725


What is meant by 'Class access modifiers'?

828