Classes Part 1 Test Review
star
star
star
star
star
Last updated over 1 year ago
21 questions
1
What is output by the code below?System.out.println( Math.floor(6.7) );
What is output by the code below?
System.out.println( Math.floor(6.7) );
1
What is output by the code below?System.out.println( Math.sqrt(144) );
What is output by the code below?
System.out.println( Math.sqrt(144) );
1
What is output by the code below?System.out.println( (int)Math.pow( Math.sqrt(40),2) );
What is output by the code below?
System.out.println( (int)Math.pow( Math.sqrt(40),2) );
1
What is output by the code below?System.out.println( Math.ceil(7.23) );
What is output by the code below?
System.out.println( Math.ceil(7.23) );
1
How many methods does Bird contain?public class Bird{ public void speak() { out.println("chirp-chirp"); } public void sayName() { out.println("baby bird"); }}
How many methods does Bird contain?
public class Bird
{
public void speak()
{
out.println("chirp-chirp");
}
public void sayName()
{
out.println("baby bird");
}
}
1
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( 7, 3 ) );
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( 7, 3 ) );
1
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.fun();
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.fun();
1
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 , 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(3 , 5) );
1
What is output by the code below?System.out.println( Math.min(16,18) );
What is output by the code below?
System.out.println( Math.min(16,18) );
1
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) );
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) );
1
What is output by the code below?System.out.println( Math.max(16,18) );
What is output by the code below?
System.out.println( Math.max(16,18) );
1
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( 7, 3 ) );
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( 7, 3 ) );
1
What is output by the code below?System.out.println( Math.pow(6,2) );
What is output by the code below?
System.out.println( Math.pow(6,2) );
1
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.fun();
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.fun();
1
What is output by the code below?System.out.println( Math.floor(9.567) );
What is output by the code below?
System.out.println( Math.floor(9.567) );
1
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.fun();x.go();
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.fun();
x.go();
1
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();
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();
1
What is output by the code below?System.out.println( Math.pow( Math.sqrt(16),2) );
What is output by the code below?
System.out.println( Math.pow( Math.sqrt(16),2) );
1
How many return methods does Bird contain?public class Bird{ public void speak() { out.println("chirp-chirp"); } public void sayName() { out.println("baby bird"); }}
How many return methods does Bird contain?
public class Bird
{
public void speak()
{
out.println("chirp-chirp");
}
public void sayName()
{
out.println("baby bird");
}
}
1
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();
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();
1
Methods Free ResponseDirections :: Fill in the show your work box with your answer with the appropriate Java code.
Directions :: Write only one method named printABox. printABox will print out the box shown below which contains 5 rows of the capital letter A. In the most efficient way possible.
AAAAAAAAAAAAAAA AAAAAAAA
Methods Free Response
Directions :: Fill in the show your work box with your answer with the appropriate Java code.
Directions :: Write only one method named printABox. printABox will print out the box shown below which contains 5 rows of the capital letter A. In the most efficient way possible.
AAAAAAA
AAAAAAA
A A
AAAAAAA