Free online quizzes and exams to copy

Tour Menu

Go back to browse: Free exams and quizzes

Free Exam: CSC180-FINAL EXAM

Number of Questions in Test: 31
Number of Questions in Preview: 5
Register to view all questions.

Note: Answers are not shown below but will be copied with this test.

Copy this test to my quiz maker account

Register with ClassMarker to copy free tests to give to your Test takers.

Register now

Question 1

Which of the following statements about classes and objects are true? (Choose all that apply.)

Type: Multiple response
Points: 2
Randomize answers: Yes
Grade style: Partial - points removed for incorrect answers

Question 2

What is the difference between an abstract class and an interface. (Choose all that apply.)

Type: Multiple response
Points: 2
Randomize answers: Yes
Grade style: Partial - points removed for incorrect answers

Question 3

Class members with default access (where no access modifier is used) are visible from which locations? (Choose all that apply.)

Type: Multiple response
Points: 2
Randomize answers: Yes
Grade style: Partial - points removed for incorrect answers

Question 4

Given the following code,

public class C{
public int k;
public C(int j){
this.k = j;
}
public static void main(String[] args){
final C c1 = new C(0);
/** INSERT CODE HERE **/
}
}

Which of the following lines of code would cause a compiler error? (Choose one.)

Type: Multiple choice
Points: 1
Randomize answers: Yes

Question 5

Given the following code,

public class MyClass{
public int i=0;
public static int count=0;
public MyClass(int j){
i = j;
count++;
}
public static void main(String[] args){
MyClass mc1 = new MyClass(1);
MyClass mc2 = new MyClass(2);
MyClass mc3 = new MyClass(3);
System.out.println(mc1.i + " " + mc1.count);
System.out.println(mc2.i + " " + mc2.count);
System.out.println(mc3.i + " " + mc3.count);
}
}

What would be output to the console when the program runs?

Type: Essay
Points: 9

Register now for a quiz maker account to create online tests for free.

ClassMarker is a Quiz maker for teachers and businesses alike.

Did you know, with ClassMarker you can: