Create an object called Teacher. Declare the following variables for the object string f_name, string subject, int age and int room_no.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter4: More Object Concepts
Section: Chapter Questions
Problem 11PE
icon
Related questions
Question

Can you please urgently assist 

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.
Transcribed Image Text: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.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Class
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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,