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
zhuklara [117]
3 years ago
5

Consider the following class definitions. public class BClass { private int x; public void set(int a) { x = a; } public void pri

nt() { System.out.print(x); } } public class DClass extends BClass { private int y; public void set(int a, int b) { //Postcondition: x = a; y = b; } public void print(){ } } Which of the following correctly redefines the method print of DClass?
(i) public void print() { System.out.print(x + " " + y); }
(ii) public void print() { super.print(); System.out.print(" " + y); }
Computers and Technology
1 answer:
Feliz [49]3 years ago
4 0

Answer:

Option (ii) is the correct option to the following code.

Explanation:

In the following code of the Java Programming Language, there is two print function after the set function then, we firstly set the value of x and print it through print function which is already declared then, we set the value of y through set function then, print the value of y through print function. So, that's why the following option is correct.

You might be interested in
What is a bitmap ???
leva [86]
<span>a representation in which each item corresponds to one or more bits of information, especially the information used to control the display of a computer screen.
</span><span>represent (an item) as a bitmap.
</span>
4 0
3 years ago
Read 2 more answers
Based on the information in the table, which of the following tasks is likely to take the longest amount of time when scaled up
kakasveta [241]

Answer:

Task A

Explanation:

8 0
3 years ago
Which is a safe Internet behavior?
Westkost [7]
Don’t give out personal information
7 0
3 years ago
Alexander studies sitting on the edge of his bed with his laptop on his lap. he complains of a sore neck. how can he best improv
kumpel [21]

The way in which Alexander can best improve his study area is that: D. he can put his computer on a desk and sit in a comfortable chair.

<h3>What is a laptop?</h3>

A laptop can be defined as a small, portable type of computer that is designed and developed by embedding both a mousepad and keyboard on it.

Also, it is usually light enough to be placed on an end user's lap while he or she is working.

In this scenario, the way in which Alexander can best improve his study area is that he can put his computer on a desk and sit in a comfortable chair.

Read more on a laptop here: brainly.com/question/26021194

#SPJ4

7 0
2 years ago
What is an implicit benefit to Monetary Policy?
Mariana [72]
The answer to your question is a
6 0
3 years ago
Other questions:
  • which of the following are used on cable trays to protect the cable insulation from direct sunlight? a. barrier strips b. solid
    5·1 answer
  • Match the steps with the actions that are involved when an internal host with IP address 192.168.10.10 attempts to send a packet
    11·1 answer
  • How to take a key off a keyboard without breaking it?
    14·1 answer
  • Why it’s important to keep the standard internet protocol TCP/IP?
    11·1 answer
  • how to answer the questions on brainly? I've typed my answer in the box but there's no submit button or whatever, and the only t
    14·2 answers
  • Which of the following is the best definition of a workplace policy?
    13·1 answer
  • Managers looking for advice on properly dealing with obsolete technology hardware can: a) consult the e-Stewards program b) seek
    9·1 answer
  • What do the groups in professional networking sites allow you to do?
    10·1 answer
  • Which of the following is an advantage of using variables?
    9·1 answer
  • Hi am feeling really happy just passed a test after a lot of tries :-)
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!