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
olasank [31]
3 years ago
11

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

nt(){ } } 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 is the correct definition of the method set of the class DClass? (i) public void set(int a, int b) { super.set(a); y = b; } (ii) public void set(int a, int b) { x = a; y = b; }
Computers and Technology
1 answer:
Stella [2.4K]3 years ago
7 0

Answer:

The answer to the given question is the option "(i)".

Explanation:

In this question, the correct option is the "(i)" because In this method definition we use the super keyword. It refers to the parent's class. In this method, we use the superclass to call the above (parent) class method. and if we choose the option (ii), It will not call the parent class. That's why we use the option (i) which is correct.

You might be interested in
Digital art is created by using
enyata [817]

Answer:

D. Computers

Explanation:

Digital art is when you make art on electronic devices.

8 0
2 years ago
To add color to the entire background of a page, users will select the ___ feature?
puteri [66]
The Fill color tab. Hope this helps!
5 0
3 years ago
To quit, a user types 'q'. To continue, a user types any other key. Which expression evaluates to true if a user should continue
devlian [24]

Answer:

!(key == 'q')

Explanation:

Based on the description, the coded expression that would equate to this would be

!(key == 'q')

This piece of code basically states that "if key pressed is not equal to q", this is because the ! symbol represents "not" in programming. Meaning that whatever value the comparison outputs, it is swapped for the opposite. In this case, the user would press anything other than 'q' to continue, this would make the expression output False, but the ! operator makes it output True instead.

3 0
2 years ago
1) what are two functions of a pick or count condition?
viktelen [127]
1.  The best option is C) pick an object at random, and keep track of how many copies of an object are left in a game.
2.   The best option is D) clockwise and counterclockwise.
3.    your 3rd question does not seem to be clear to me.
3 0
3 years ago
Does a triangle with sides of lengths 1.5 ft, 2.5 ft, and 2 ft form a right triangle? How do you know?
timama [110]

Answer:

Yes, the side lengths of 1.5, 2.5, and 2 ft form a right triangle.

Explanation:

Before we solve this problem, we need to know a couple of things.

In a right triangle, you have two legs and a diagonal line that goes from one leg to the other or from one side to the other. This line is called the hypotenuse. It is the longest side of a right triangle. This length can be calculated by using a special formula that is over a thousand years old.

The formula is called the Pythagorean Theorem.

The formula states that if you square one leg and the other leg and add it up. You get the side of hypotenuse which is squared as well.

Here it is in simple terms: a^{2} +b^{2} =c^{2}.

a and b are your two legs.

C is your hypotenuse.

In this case 1.5 and 2 are your legs and 2.5 is your hypotenuse since it is the longest side.

Before we calculate, there is a converse to the Pythagorean Theorem.

If a^{2} +b^{2} \neq c^{2}, then it is not a right triangle.

Lets make 1.5 for a

and 2 for b.

We know 2.5 is for c.

Here it is.

1.5^{2} +2^{2} =2.5^{2}. The / means it is a fraction.

1.5 squared is 9/4 and 2 squared is 4. Add 4 and 9/4 and you get 25/4 squared. Take the square root of 25/4 and you get 5/2.

5/2 is equal to 2.5, so the Pythagorean Theorem applies to this triangle. Therefore, these side lengths do form a right triangle.

Hope this helps!

3 0
3 years ago
Other questions:
  • How do smart watches affect the business and its position in the global marketplace?
    12·2 answers
  • ____ is the most widely used language for writing system software because it combines the power of a high-level language with th
    12·1 answer
  • A palindrome is a string that reads the same both forward and backward. For example, the string madam is a palindrome. Write a p
    13·1 answer
  • Blood Alcohol Level (BAL) is the ratio between the alcohol consumed and the blood in the body. A. True B. False
    12·2 answers
  • Project: big research project
    15·2 answers
  • You are given a 5-letter word (for example, abcde). Write a C-Program which outputs all possible unique 5 letter permutations of
    13·1 answer
  • Read two numbers from user input. Then, print the sum of those numbers. Hint - Copy/paste the following code, then just type cod
    9·1 answer
  • What is the codebook?
    6·1 answer
  • This code --> plt.plot(x,y) is used to draw :
    8·1 answer
  • Why is it important for organizations to make strong commitment to Cloud at scale?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!