Methods Quiz
By Mickey Arnold
starstarstarstarstarstarstarstarstarstar
Last updated 10 months ago
10 Questions
1 point
1
Question 1
1.
What is a method?
What is a method?
1 point
1
Question 2
2.
When writing a method, you must always have an open and close what ?
When writing a method, you must always have an open and close what ?
1 point
1
Question 3
3.
What is output by the code below?public class CS{ public void one() { System.out.print("fun"); }}//code in the main of another classCS test = new CS();test.one();
What is output by the code below?
public class CS
{
public void one()
{
System.out.print("fun");
}
}
//code in the main of another class
CS test = new CS();
test.one();
1 point
1
Question 4
4.
What is output by the code below?public class CS{ public void one() { System.out.print("fun"); }}//code in the main of another classCS test = new CS();test.one();test.one();
What is output by the code below?
public class CS
{
public void one()
{
System.out.print("fun");
}
}
//code in the main of another class
CS test = new CS();
test.one();
test.one();
1 point
1
Question 5
5.
What is output by the code below?public class CS{ public void one() { System.out.print("fun"); }}//code in the main of another classCS test = new CS();test.one();test.one();test.one();test.one();
What is output by the code below?
public class CS
{
public void one()
{
System.out.print("fun");
}
}
//code in the main of another class
CS test = new CS();
test.one();
test.one();
test.one();
test.one();
1 point
1
Question 6
6.
What is output by the code below?public class CS{ public void one() { System.out.print("go"); } public void two() { System.out.print("back"); }}//code in the main of another classCS test = new CS();test.one();test.two();
What is output by the code below?
public class CS
{
public void one()
{
System.out.print("go");
}
public void two()
{
System.out.print("back");
}
}
//code in the main of another class
CS test = new CS();
test.one();
test.two();
1 point
1
Question 7
7.
What is output by the code below?public class CS{ public void one() { System.out.print("go"); } public void two() { System.out.print("back"); }}//code in the main of another classCS test = new CS();test.one();test.two();test.two();
What is output by the code below?
public class CS
{
public void one()
{
System.out.print("go");
}
public void two()
{
System.out.print("back");
}
}
//code in the main of another class
CS test = new CS();
test.one();
test.two();
test.two();
1 point
1
Question 8
8.
What is output by the code below?public class CS{ public void one() { System.out.print("go"); } public void two() { System.out.print("back"); }}//code in the main of another classCS test = new CS();test.one();test.two();test.one();test.two();
What is output by the code below?
public class CS
{
public void one()
{
System.out.print("go");
}
public void two()
{
System.out.print("back");
}
}
//code in the main of another class
CS test = new CS();
test.one();
test.two();
test.one();
test.two();
1 point
1
Question 9
9.
What is output by the code below?public class CS{ public void one() { System.out.print("go"); } public void two() { System.out.print("back"); }}//code in the main of another classCS test = new CS();test.two();test.one();test.two();
What is output by the code below?
public class CS
{
public void one()
{
System.out.print("go");
}
public void two()
{
System.out.print("back");
}
}
//code in the main of another class
CS test = new CS();
test.two();
test.one();
test.two();
1 point
1
Question 10
10.
What is output by the code below?public class CS{ public void one() { System.out.print("go"); } public void two() { System.out.print("back"); }}//code in the main of another classCS test = new CS();test.one();test.two();test.two();test.one();
What is output by the code below?
public class CS
{
public void one()
{
System.out.print("go");
}
public void two()
{
System.out.print("back");
}
}
//code in the main of another class
CS test = new CS();
test.one();
test.two();
test.two();
test.one();