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);
}
}
Java Classes & Objects

Flashcard
•
Computers
•
University
•
Hard
Quizizz Content
FREE Resource
Student preview

3 questions
Show all answers
1.
FLASHCARD QUESTION
Front
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.
Similar Resources on Quizizz
5 questions
QC FNES 146 pre/post Chapter 2

Flashcard
•
University
2 questions
Câu hỏi về mã lập trình

Flashcard
•
University
8 questions
Educational Development 268 Flashcard

Flashcard
•
KG
10 questions
Static Methods in Java

Flashcard
•
12th Grade
8 questions
AzM2 Part 1

Flashcard
•
Professional Development
10 questions
Test Administration Procedures

Flashcard
•
KG - University
8 questions
Privacy Concern and Ethical Use of Students' Data

Flashcard
•
Professional Development
4 questions
NSO Day 1

Flashcard
•
University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade