0
How to invoke class counstructor in another class without inharetence (extends)
• The class has 2 private string instance variables flightNo, bookingRef. • The class has 1 private instance variable of the class MyDate. • The class has a multi-argument constructor that sets the value of its instance variables to given values. It should create the object of MyDate and set the values of day, month, and year using appropriate method.
1 Respuesta
+ 8
Use
new YourClass()
to invoke the constructor of YourClass.