Classes Part 1 Re-Test
star
star
star
star
star
Last updated over 1 year ago
6 questions
16
What is output by the code below?System.out.println( Math.sqrt(25) );
What is output by the code below?
System.out.println( Math.sqrt(25) );
16
What is output by the code below?System.out.println( (int)Math.pow( Math.sqrt(12),2) );
What is output by the code below?
System.out.println( (int)Math.pow( Math.sqrt(12),2) );
16
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"); }}
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");
}
}
16
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) );
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) );
16
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) );
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) );
20
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\
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\