Create a 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 parameterised...

Create a 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 parameterised constructor. The parameterised constructor has the following parameters (name and age). Create your main class Teaching. The reference variable for the default constructor is T1 and for the parameterised 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 variable using the T2 reference to the parameterised constructor: name = Smith age = 45 Program must include System.out statements to display the output.

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here