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]
2 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]2 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
A line of text that has an equal number of characters on either side of the horizontal center of the page is called____.
VLD [36.1K]
A) force justified.

If you open up Word (or probably any word processor) and hover over the alignment options in the ribbon (or format the paragraph), it tells you what each one is, and the option that ensures the characters are spread evenly between the margins is labeled "justified."
6 0
3 years ago
Communication among office computers is based on a protocol that uses CRC-32 for error detection. A series of 100 identical test
Fiesta28 [93]
I think it is the CRC-32 for error detection
4 0
2 years ago
Named constants should be used when they serve to improve readability and understanding. T or F
prisoha [69]
The answer is true.

Let's say we are calculating the volume of a grain silo where the the width is a constant, but the height can be changed.

In our code we would calculate the volume using something like:

PI * (WIDTH / 2)^2 * height

The variables in all caps would be named constants. Using them makes the code more readable to other people than if we were to just use their values like:

3.14 * (145.75 / 2)^2 * height




8 0
3 years ago
Read 2 more answers
Which item can you add using the tag?
Svetllana [295]

Answer:

an image

Explanation:

good luck have a nice day

3 0
3 years ago
Read 2 more answers
Match the definition with the corresponding word
Oksana_A [137]

Answer:

Ram is your memory

that's all i know

4 0
3 years ago
Read 2 more answers
Other questions:
  • What are a few benefits of virtualization?<br> How do they benefit ?
    9·1 answer
  • Two different names that refer to the same data item best defines:
    12·1 answer
  • __________ was awarded the Nobel Prize in physics forhis work on the photoelectric effect.
    13·1 answer
  • Match each scenario to the absolute value expression that describes it. 1. the distance moved when going backwards five spaces i
    13·2 answers
  • Billy used to take care of his laptop. However, one day he lost his laptop. He lost all his data, and there was no way to retrie
    11·1 answer
  • What is a Forloop and what is it used for?
    7·2 answers
  • What do computer programs generally try to solve and how? A) Computer programs generally try to solve a well-defined problem usi
    14·1 answer
  • Anyone who know hacking​
    7·1 answer
  • Which of the following is typiacally the last step of the mail merge process
    11·1 answer
  • As a technical support rep, michael is responding to a customer's question sent to him via e-mail. what should michael's first t
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!