Java Classes & Objects

Java Classes & Objects

Assessment

Flashcard

Computers

University

Hard

Created by

Wayground Content

FREE Resource

Student preview

quiz-placeholder

3 questions

Show all answers

1.

FLASHCARD QUESTION

Front

Predict the output of following Java program?
class Test {
int i;
}
class Main {
public static void main(String args[]) {
Test t;
System.out.println(t.i);
}
}

Back

Compiler Error

2.

FLASHCARD QUESTION

Front

Predict the output of following Java program: class Test { int i; } class Main { public static void main(String args[]) { Test t = new Test(); System.out.println(t.i); } }

Back

0

3.

FLASHCARD QUESTION

Front

Given that Student is a class, how many reference variables and objects are created by the following: Student studentName, studentId; studentName = new Student(); Student stud_class = new Student();

Back

Three reference variables and two objects are created.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers