Classes Part 1 Test
star
star
star
star
star
Last updated over 1 year ago
21 questions
4
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) );
4
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) );
4
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) );
4
What is output by the code below?
System.out.println( (int)Math.pow( Math.sqrt(60),2) );
What is output by the code below?
System.out.println( (int)Math.pow( Math.sqrt(60),2) );
4
What is output by the code below?System.out.println( Math.pow( Math.sqrt(25),2) );
What is output by the code below?
System.out.println( Math.pow( Math.sqrt(25),2) );
4
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) );
4
What is output by the code below?System.out.println( Math.max(26,18) );
What is output by the code below?
System.out.println( Math.max(26,18) );
4
What is output by the code below?System.out.println( Math.min(36,8) );
What is output by the code below?
System.out.println( Math.min(36,8) );
4
What is output by the code below?System.out.println( Math.sqrt(64) );
What is output by the code below?
System.out.println( Math.sqrt(64) );
4
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 ) );
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 ) );
4
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 ) );
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 ) );
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(6 , 7) );
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) );
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(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) );
4
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");
}
}
4
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");
}
}
4
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();
4
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();
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();
4
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();
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();
4
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();
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();
4
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();
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();
20
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.
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.