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 output will the LOOKUP rmula below produce in relation to the following table?
Lana71 [14]

Answer:

The correct answer is (C)-Rainly

Explanation:

The following data is given in this question

Column A    Column B

3.25             Clear

3.91              Cloudy

4.23             Windy

4.67              Rainy

5.12               Snowy

5.98              Sunny

As we know that the Microsoft Excel LOOKUP function returns a value from a range (one row or one column) or from an array.

The use of lookup function is given below

LOOKUP(4.67,A1:A6,B1:B6)

When you execute this function on the given ranges , then it display "Rainly" as a result.

Furthermore, the complete example is attached with this solution

3 0
3 years ago
A feature on a new computer with Windows preinstalled. When you take it out of the box and turn it on, you will be greeted with
BlackZzzverrR [31]

Answer:

Explanation:

In the newer versions of windows, there are a variety of sign-in methods, these include facial recognition, fingerprint scanner, username & password, or Microsoft email sign in. The choice is yours at the end of the Out-of-box experience which is the entire setup experience that the consumer has when first preparing the new windows installation on the computer that they have. Some of the options may require additional hardware on your PC such as a fingerprint scanner or a webcam for facial recognition.

6 0
3 years ago
A train protection system automatically applies the brakes of a train if the speed limit for a segment of track is exceeded, or
scoray [572]

<u>Explanation:</u>

<em>Five possible </em><em>functional system requirements for the onboard software</em><em> that may be generated from the system safety requirements:</em>

  • software should enable the brakes to be applied instantly when the red light is signaled.
  • speed of the train should be monitored when it's running on a segment so that it does not exceed the maximum speed limit.
  • important for the system to examine the color displayed before a train enters a segment of the track.
  • constant checking of the speed limit and color of the light so as to determine when the brakes should be applied.
  • when there is a red light the system should notify/prevent the train from entering the segment.
4 0
3 years ago
Routers:
kaheart [24]

Answer:

C

Explanation:

Use data link layer addresses to move packets that leave the subnet.

4 0
4 years ago
Write an algorithm to find perimeter of circle<br>​
Anna11 [10]

Answer:

Here’s one!

Given [math]R[/math], the radius of the circle.

Let [math]N,D\leftarrow 0[/math]

Repeat until [math]D[/math] is large enough (about 1,000,000)

[math]x,y\leftarrow U[0,1][/math]

If [math]x^2 + y^2\le 1[/math] then [math]N\leftarrow N+1[/math]

[math]D\leftarrow D+1[/math]

[math]P\leftarrow\frac{8NR}{D}[/math]

Return [math]P[/math]

[math]U[0,1][/math] is a uniform random number in the range [math][0,1][/math].

Explanation:

6 0
3 years ago
Other questions:
  • Open Source software is:
    6·1 answer
  • What makes us see continuously moving images when still images appear in rapid succession
    11·1 answer
  • Horizontal scaling of a client/server architecture means _____.
    12·1 answer
  • Which type of financial institution typically has membership requirements?
    14·1 answer
  • You are looking at a standard english ruler divided into eighths. If an item
    7·1 answer
  • If you have an ordered list of all the states in North America, and you want to add a title "States of North America", what tag
    14·1 answer
  • A secret information for using email is ____________
    12·2 answers
  • Tools used to build a bridge<br>​
    15·1 answer
  • When you use transact-sql, you can store procedural code in:
    14·1 answer
  • use c , c, java or python (any one) programming language for the following programming exercises. do not call built-in library f
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!