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
Which activity uses a feature of a word processor?
Anvisha [2.4K]
The activity that uses a feature of a word processor is the last given answer. Recreating the same document multiple times to print multiple copies. Although some word processors have all the features stated above now a days. Word processors are helpful in composing, editing and printing text documents.
3 0
4 years ago
Read 2 more answers
#5 Multiple Select Which of the following describes a hardware error? Select 3 options.
DENIUS [597]

Answer:

A, E

Explanation:

Hope this is correct

7 0
3 years ago
Read 2 more answers
___________ is produced by propulsion systems or engines.
Rama09 [41]
I think it’s thrust good luck
8 0
3 years ago
Which best describes an advantage of creating a contact group?
Lapatulllka [165]
More than one contact can be added to the group at a time.
8 0
4 years ago
Place the following discoverers in the correct chronological order of the timeframe for their discoveries, from earliest to most
Alex787 [66]
The correct order or answer is the 2nd choice.

Pythagoras, Gauss, Edison, Hawking. The following are the most noted discoveries of each.

Pythagoras, 500 B.C. School Of Mathematics and Pythagorean theorem.Edison, Year 1879 - Invention of incandescent light bulb.Gauss, Year 1801 - Therom of Alegbraic Solution. Stephen Hawking Year1980 - Studies in cosmology particularly contributing to the context of black holes.
5 0
3 years ago
Other questions:
  • Two electronics technicians are measuring electrical quantities in circuits. Technician A says that copper, glass, porcelain, an
    11·1 answer
  • How to charge your phone quickly
    9·2 answers
  • The program is to be answered in Java Programming not C++ Please answer the following: Modify the BarChart program to accept the
    6·1 answer
  • Llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
    7·1 answer
  • Select the correct answer from each drop-down menu. Which two factors do ergonomic principles consider a part of a job? Ergonomi
    10·1 answer
  • To inspire unit 1 App
    11·1 answer
  • 13. A 2-sided coin has an equal likelihood of landing on each side. One side is called "heads" and the other is called "tails".
    11·1 answer
  • Brainly is brainly am I correct ​
    11·2 answers
  • 20 points for ez question lol
    9·2 answers
  • 18. WHICH MENU WOULD MOST LIKELY ALLOW YOU TO ADJUST YOUR LINE SPACING? *
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!