gudii9
asked on
default constructor and arguments
class Parent {
//Parent(){}
Parent(){}
Parent(int number) {
}
}
class Child extends Parent {
Child(int a, int b) {
}
}
for above code do not i need to give constructor as below with two arguments?
Parent(int a, int b){}
//if i give constructor like above does it still called default constructor?
what is the meaning of below sentence?
4. The default constructor is only generated by the compiler:https://www.codejava.net/java-core/the-java-language/9-rules-about-constructors-in-java
If we explicitly write a constructor that looks exactly the same as the default constructor, it is NOT called the default constructor.
Please advise
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.