1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
bagirrra123 [75]
3 years ago
15

he superclass Student contains: a constructor that accepts a String corresponding to the name of the school the student attends

a toString method that returns 'student at X' where X is the name of the school the student attends. Write a public subclass HighSchoolStudent, based on Student, which contains: a constructor accepting a String which is used as a parameter to the superclass constructor a toString method that returns 'high school student at X'. This method must use the toString method of its superclass.
Computers and Technology
1 answer:
natita [175]3 years ago
3 0

Solution :

public $\text{class}$ Student {

$\text{protected String}$ school$;$

public $\text{Student}$(String school) {

$\text{this.school}$ = school;

}

public String $\text{toString}()$ {

return $\text{"student at"}$ + school;

}

}

HighSchool$\text{Student.java}$ :

public class $\text{HighSchoolStudent}$ extends Student {

public $\text{HighSchoolStudent}$(String school) {

super$\text{(school)}$;

}

public String $\text{toString}()$ {

return $\text{"high school"}$ + super.$\text{toString}()$;

}

}

You might be interested in
____ is a philosophy and a software and system development methodology that focuses on the development, use, and reuse of small,
LiRa [457]

Answer:

d.) Service-Oriented Architecture

Explanation:

Because its definition matches

4 0
3 years ago
What is nested selection?
kodGreya [7K]

Answer:

I think its 4 I'm not so sure though

7 0
3 years ago
_________________: informal messages that are passed on from person to person
sasho [114]

Answer:

Grapevine is the answer

4 0
3 years ago
Question 5 of 10
Drupady [299]
The programs you need for you are not even done yet
3 0
2 years ago
How is a non-disclosure agreement an important tool for businesses?
Sloan [31]

Answer:

D

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • Is a component that provides a button control in a gui application or applet?
    15·1 answer
  • What is the problem with assigning a port number to more than one server application?
    8·1 answer
  • What is the best way to protect computer equipment from damage caused by electrical spikes
    15·1 answer
  • "You are setting up a new subnetwork on an existing network. Management has asked that you use existing cabling that the company
    14·1 answer
  • Convert 578.2 into hexadecimal​
    9·1 answer
  • What is the difference between php and html?​
    13·2 answers
  • What is a trusted computing base (TCB)? Hosts on your network that support secure transmissions The operating system kernel and
    9·1 answer
  • Explain the pros and cons of touchscreen, non-touchscreen, and hybrid devices:
    12·1 answer
  • A network administrator wants to authenticate server machines using Transport Layer Security (TLS). What can the administrator i
    15·1 answer
  • What dictionary operation can you use to remove all the keys within the dictionary-named contacts?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!