Find the output of the following program.
short x = 10;
x = x * 5;
System.out.print(x);
Java set 1
Quiz
•
Other
•
University
•
Hard
ESPARK 2023
Used 2+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Find the output of the following program.
short x = 10;
x = x * 5;
System.out.print(x);
50
10
compile error
exception
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Identify what can directly access and change the value of the variable res. package com.mypackage;
public class Solution{
private int res = 100;
}
Any class
only Solution class
any class that extends solution
none
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
To which of the following does the class string belong to.
java.lang
java.applet
java.awt
java.string
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Output of Math.floor(5.9)?
5
6
5.0
5.5
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the variables declared in a class for the use of all methods of the class called?
Object
Instance variables
Reference variables
None
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When is the finalize() method called?
Before Garbage Collection
Before an Object goes out of Scope
None
Before a variable goes out of Scope
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Identify the infinite loop
for(;;)
for(int i=0;i<1;i++)
for(int i=0;;i++)
All of the Above
15 questions
C Quiz
Quiz
•
University
12 questions
JAVA FUNDAMENTALS
Quiz
•
University
6 questions
Elementary Java 2
Quiz
•
University
10 questions
Recordando JavaScript
Quiz
•
University
14 questions
2R C-Skill Lab Test Autumn 2024-25
Quiz
•
University
10 questions
اختبار مدرسي الحاسوب في المعرض السنوي 2025
Quiz
•
University
7 questions
Primeiro Quizz
Quiz
•
University
10 questions
ANIME!!
Quiz
•
5th Grade - Professio...
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