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 the function of a breadcrumb trail website
ziro4ka [17]

Breadcrumb or breadcrumb trail is a graphical control element frequently used as a navigational aid in user interfaces and on web pages. It allows users to keep track and maintain awareness of their locations within programs, documents, or websites.

7 0
3 years ago
An online bank wants you to create a program that shows prospective
ladessa [460]

Answer: I can't really code a whole thing for you but use VS Code for this it'll make your life easier in the long run.

8 0
2 years ago
Write a function called st_dev. st_dev should have one
aleksandrvk [35]
Huluttttttt!!! greggyffh
8 0
1 year ago
How will you identify a file type on your computer?
Andru [333]

You use the extension on the end of the file to tell you the type of a file

The extension is the .whatever in the name of the file

5 0
2 years ago
Suzy lives alone in New York, whereas her family lives in Florida. It is difficult for Suzy to visit her family very frequently,
Luda [366]
Answer:

<span>Skype.

---> Skype can most probably help Suzy given that the application allows for people to message, talk and video chat. This means that Suzy can see her family through video call, and see their face.

Best of wishes! xx :)</span>
4 0
3 years ago
Read 2 more answers
Other questions:
  • Define the method object inc_num_kids() for personinfo. inc_num_kids increments the member data num_kids. sample output for the
    11·1 answer
  • What will happen with communication methods in five years?
    8·1 answer
  • In which setting would you be least likely to find a full-time A/V technician?
    5·2 answers
  • How do I connect my CSS file and HTML page together? it's just not wanting to work for me. 
    5·1 answer
  • Instructions Write a program that asks the user for a number. If the number is between 1 and 255, the program outputs the corres
    15·1 answer
  • In Windows Vista, the Run command can be found in which application?
    6·1 answer
  • A(n) ____ is a service from local telephone companies in which up-to-date telephone facilities at the telephone company s centra
    9·1 answer
  • Suppose that f is a function with a prototype like this: void f(________ head_ptr); // Precondition: head_ptr is a head pointer
    6·1 answer
  • In an array-based implementation of a dictionary, if you represent the entries as an array of objects that encapsulate each sear
    12·1 answer
  • Imagine an everyday scenario in which you are using the internet: downloading a file, uploading a photo, checking your email, et
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!