Log in
Sign up for FREE
arrow_back
Library
Classes Part 1 Test
By Mickey Arnold
star
star
star
star
star
Share
share
Last updated almost 2 years ago
21 questions
Add this activity
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
20
Question 1
1.
What is output by the code below?
System.out.println( Math.floor(9.567) );
visibility
View drawing
Question 2
2.
What is output by the code below?
System.out.println( Math.ceil(7.23) );
visibility
View drawing
Question 3
3.
What is output by the code below?
System.out.println( Math.pow(6,2) );
visibility
View drawing
Question 4
4.
What is output by the code below?
System.out.println( (int)Math.pow( Math.sqrt(60),2) );
visibility
View drawing
Question 5
5.
What is output by the code below?
System.out.println( Math.pow( Math.sqrt(25),2) );
visibility
View drawing
Question 6
6.
What is output by the code below?
System.out.println( Math.floor(6.7) );
visibility
View drawing
Question 7
7.
What is output by the code below?
System.out.println( Math.max(26,18) );
visibility
View drawing
Question 8
8.
What is output by the code below?
System.out.println( Math.min(36,8) );
visibility
View drawing
Question 9
9.
What is output by the code below?
System.out.println( Math.sqrt(64) );
visibility
View drawing
Question 10
10.
What is output by the code below?
public class Fun
{
public int times(int num1, int num2)
{
return num1 * num2;
}
}
Fun aplus = new Fun();
System.out.println( aplus.times( 8, 6 ) );
visibility
View drawing
Question 11
11.
What is output by the code below?
public class Fun
{
public int times(int num1, int num2)
{
return num1 + num2;
}
}
Fun aplus = new Fun();
System.out.println( aplus.times( 23, 13 ) );
visibility
View drawing
Question 12
12.
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(6 , 7) );
visibility
View drawing
Question 13
13.
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(5 , 5) );
visibility
View drawing
Question 14
14.
How many methods does Bird contain?
public class Bird
{
public void speak()
{
out.println("chirp-chirp");
}
public void sayName()
{
out.println("baby bird");
}
}
visibility
View drawing
Question 15
15.
How many return methods does Bird contain?
public class Bird
{
public void speak()
{
out.println("chirp-chirp");
}
public void sayName()
{
out.println("baby bird");
}
}
visibility
View drawing
Question 16
16.
What is output by the code below?
public class Test
{
public void go()
{
out.print("A");
}
public void fun()
{
out.print("B");
}
}
Test x = new Test();
x.go();
visibility
View drawing
Question 17
17.
What is output by the code below?
public class Test
{
public void go()
{
out.print("A");
}
public void fun()
{
out.print("B");
}
}
Test x = new Test();
x.go();
x.go();
x.go();
visibility
View drawing
Question 18
18.
What is output by the code below?
public class Test
{
public void go()
{
out.print("A");
fun();
}
public void fun()
{
out.print("B");
}
}
Test x = new Test();
x.fun();
x.go();
visibility
View drawing
Question 19
19.
What is output by the code below?
public class Test
{
public void go()
{
out.print("A");
}
public void fun()
{
out.print("B");
go();
}
}
Test x = new Test();
x.go();
x.fun();
x.fun();
visibility
View drawing
Question 20
20.
What is output by the code below?
public class Test
{
public void go()
{
out.print("A");
stop();
}
public void fun()
{
out.print("B");
go();
}
public void stop()
{
out.print("C");
}
}
Test x = new Test();
x.fun();
visibility
View drawing
Question 21
21.
Write only
one
method named
printAThis
.
printAThis
will print out the shown below.
This Test is so "easy".
I will probably get 5\5 right.