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 are some examples of environmental technology
Zarrin [17]
Some examples of environmental technology is recycling.
3 0
3 years ago
Which process improves the life of a computer?
arlik [135]

maintenance is the answer

3 0
4 years ago
Greg works for online games development company. He occasionally visits online literature sites and downloads e-books of his cho
zalisa [80]

(A) Yes, because nobody is supposed to access non-work related sites during office hours.

3 0
3 years ago
Read 2 more answers
What are common tasks Human Services workers perform? Check all that apply.
Ainat [17]

Answer: B, D, E, F

Explanation:

I got I right.

7 0
3 years ago
Read 2 more answers
Why has Unicode become the standard way of converting binary to text?
Zigmanuir [339]
The standard for internal text coding system is called Unicode (Encoding, representation and handling text). Nearly every operating system uses this. The basic reason for choosing Unicode for converting binary to text is because this is compatible with almost every language in the world making it popular. Although there are other ways to do this, Unicode stays popular of all.
5 0
3 years ago
Other questions:
  • Write a Python function merge_dict that takes two dictionaries(d1, d2) as parameters, and returns a modified dictionary(d1) cons
    5·1 answer
  • You're browsing the Internet and realize your browser is not responding. Which of the following will allow you to immediately ex
    5·2 answers
  • When you’re in the Normal view, what are the visible panes?
    15·2 answers
  • In 4-bit sign magnitude representation, what is the binary encoding of the number -5?
    15·1 answer
  • Which of the following operations are considered to be crucial tasks that should be performed before installing server roles and
    14·1 answer
  • If you've finished working with a data file but intend to work on it again during your work session, which button would you use
    10·2 answers
  • Before you ever buy your first stock or bond, it's important to understand what type of investor you are. This depends on a numb
    12·1 answer
  • .....is used to save project in Visual basic .net from file menu
    6·1 answer
  • Computers that are joined together are called networks true or false
    10·1 answer
  • Using a wireless technology known as ___, many smartphones can now be tapped on special payment devices to complete your purchas
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!