Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1) A class from which objects are created contains what kind of methods? a. Inst

ID: 3705707 • Letter: 1

Question

1) A class from which objects are created contains what kind of methods?

a. Instance methods

b. Void methods

c. Static methods

d. All of the answers are correct

2) What is Math.floor(5.2)?

a. 5

b. 4.0

c. 5.0

3) Analyze the following code.

public class Test {
public static void main(String[] args) {
int n = 2;
xMathod(n);
   
System.out.println("n is " + n);
}
public static void xMethod(int n) {
n++;
}
}

a. The code prints n is 1.

b. The code prints n is 2.

c. The code prints n is 3.

d. The code has a syntax error because xMethod does not return a value.

4) Which of the following could be an argument to a method?

a. Constants.

b. Variables.

c. Expressions.

d. All of the answers are correct

5) Which of the following method returns the sine of 90 degrees?

a. Math.sine(90)

b. Math.sin(90)

c. Math.sin(PI)

d. Math.sin(Math.toRadian(90))

Explanation / Answer

Ans1. Option D

Ans2. Option C

Ans3. Option B

Ans4. Option B

Ans5. Option B