Preskoči na glavni sadržaj
Prijava
Sign up for FREE
arrow_back
Biblioteka

Classes Part 1 Re-Test

star
star
star
star
star
Posljednje ažuriranje about 2 years ago
6
16
Pitanje 1
1.

What is output by the code below?

System.out.println( Math.sqrt(25) );

16
16
16
16
20
Pitanje 2
2.

What is output by the code below?

System.out.println( (int)Math.pow( Math.sqrt(12),2) );

Pitanje 3
3.

How many methods does Bird contain?(enter a number)

public class Bird

{

public void speak()

{

out.println("chirp-chirp");

}

public void sayName()

{

out.println("baby bird");

}

public void fly()

{

out.println("moving wings");

}

}

Pitanje 4
4.

What is output by the code below?

public class Fun2

{

public static int times(int num1, int num2)

{

return num1 * num2;

}

}

System.out.println( Fun2.times(3 , 6) );

Pitanje 5
5.

What is output by the code below?

public class Fun2

{

public static int times(int num1, int num2)

{

return num1 + num2;

}

}

System.out.println( Fun2.times(15 , 25) );

Pitanje 6
6.

Methods Free Response

Directions :: Write only one method named printMethod. It should output what below. In the most efficient way possible.

Output:

"AAAAAA"

AAAAAA

'AAAAAA'

\AAAAAA\