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

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 8PE
icon
Related questions
Question
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.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
JQuery and Javascript
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning