Examlex

Solved

Example Code Ch 09-5

question 13

Multiple Choice

Example Code Ch 09-5
Consider the following class definition:
public class AClass
{
protected int x;
protected int y;
public AClass(int a, int b)
{
x = a;
y = b;
}
public int addEm()
{
return x + y;
}
public void changeEm()
{
x++;
y--;
}
public String toString()
{
return "" + x + " " + y;
}
}
-Refer to Example Code Ch 09-5: Which of the following would best redefine the toString method for BClass?


Definitions:

Percentage

A mathematical concept expressing a quantity as a fraction of 100.

Fraction

A mathematical concept where a number is represented as a part of a whole, expressed as a numerator divided by a denominator.

Roman Numeral

A system of numerical notation that uses the letters I, V, X, L, C, D, and M to represent numbers.

Exponent

A mathematical notation indicating the number of times a number (the base) is multiplied by itself.

Related Questions