Methods Quiz
star
star
star
star
star
Last updated over 1 year ago
10 questions
1
What is a method?
What is a method?
1
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
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
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
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
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
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
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
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
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();