Log in
Sign up for FREE
arrow_back
Library
Classes Part 1 Re-Test
By Mickey Arnold
star
star
star
star
star
Share
share
Last updated almost 2 years ago
6 questions
Add this activity
16
Question 1
1.
visibility
View drawing
16
16
16
16
20
What is output by the code below?
System.out.println( Math.sqrt(25) );
Question 2
2.
What is output by the code below?
System.out.println( (int)Math.pow( Math.sqrt(12),2) );
Question 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");
}
}
Question 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) );
Question 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) );
Question 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\
visibility
View drawing