Create your main class called Teaching. The reference variable for the default constructor is T1 and for the parameterized
Create an object called Teacher. Declare the following variables for the object: string f_name, string subject, int age and int
room_no.
Include in the object a default constructor and a parameterized constructor. The parameterized constructor has the following
parameters (name and age).
Create your main class called Teaching. The reference variable for the default constructor is T1 and for the parameterized
constructor is T2.
Pass the following values for the T1 reference to the default constructor:
f_name = John
subject = Science
age = 35
room_no = 10
Pass the following variables using the T2 reference to the parameterized constructor:
name = Smith
age = 45
Your program must include System.out statements to display the output.
Step by step
Solved in 4 steps with 2 images