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
Suggest me anime genre : adventure ecchi​
Ronch [10]
HUMAGUSHIE that’s is the genre of ADVENTURE ECCHI
6 0
3 years ago
I have one big question <br><br><br> WHAT CAN I DO WHEN I'M BORED
disa [49]

Answer:

You can start watching Your lie in april. Its awesome anime show about a girl who plays violin and a boy who played piano and he really likes her but she has leg cancer and can only live for a few months.

Explanation:

Even though it sounds really heartbreaking, it is actually pretty cool and romantic and it is on netflix. You should check it out!

5 0
4 years ago
Read 2 more answers
Which company has the comparative advantage in producing large tubes of toothpaste?
juin [17]

Answer:

Explanation:

This question is about a comparative advantage, this is the ability to produce a good service at lower opportunity cost, in this case, there is table with 4 companies, where one of them has this comparative advantage, but this depends on what company can produce more large of toothpaste because the costumer can find the product in a lower price.

There are four companies in this example:

Sparkling

Bright White

Fresh!

Mmmint

Choose the company that can produce more products assuming the table.

4 0
3 years ago
Read 2 more answers
Please answer<br><br> 1st part
vova2212 [387]

Answer:

a standard size Shani thing try Tuscon design retain watching we ftrtttttt5yu haha driving

7 0
3 years ago
Read 2 more answers
What allows you to jump to a specific pet of a document
Viefleur [7K]

Answer:

C - Go-To

Explanation:

You would be "Going To" a part of the page.

6 0
2 years ago
Other questions:
  • A pacing calendar is provided to students so they can:
    8·2 answers
  • A user has requested to have an extra 4GB of memory installed on a laptop. During the Installation process, which of the followi
    6·1 answer
  • What need most led to the creation of the Advanced Research Projects Agency Network? DARPA wanted scientists to be able to colla
    10·2 answers
  • When a range of IP addresses is set aside for client devices, and one of these IPs is issued to these devices when they request
    14·1 answer
  • What is the QOS model?
    6·1 answer
  • Create a Rational number class in Java using the same style as the Complex number class created in class.(The in class example c
    12·1 answer
  • If you're using the paintbrush tool and want to change the color of the paint being used what should you change
    6·1 answer
  • Write a program that sorts a vector of names alphabetically using the selection sort and then searches the vector for a specific
    7·1 answer
  • Which of the following is true about ISO___________.
    5·1 answer
  • You can open an HTML document only in ________.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!