
Java Programming - Quiz 1

Quiz
•
University - Professional Development
•
Hard

Shom Das
Used 49+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the following,
1. public class Test {
2. public static void main(String [] args) {
3. signed int x = 10;
4. for (int y=0; y<5; y++, x--)
5. System.out.print(" " + x);
6. }
7. }
what is the result? (Choose one.)
10 9 8 7 6
9 8 7 6 5
Compilation fails
An exception is thrown at runtime
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which one of these lists contains only Java programming language keywords? (Choose one.)
class, if, void, long, Int, continue
goto, instanceof, native, finally, default, throws
try, virtual, throw, final, volatile, transient
strictfp, constant, super, implements, do
byte, break, assert, switch, include
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the numerical range of a char? (Choose one.)
–128 to 127
–(2 ^ 15) to (2 ^ 15) - 1
0 to 32767
Platform dependent
0 to 65535
4.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Which three are valid declarations of a float? (Choose three.)
float f1 = -343;
float f2 = 3.14;
float f3 = 0x12345;
float f6 = 2.81F;
float f5 = 2001.0D;
5.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Which two demonstrate encapsulation of data? (Choose Two)
Member data have no access modifiers.
Member data can be modified directly.
The access modifier for methods is protected.
The access modifier to member data is private.
Methods provide for access and modification of data.
6.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Which two valid declarations of a char? (Choose Two)
char ch = “a”;
char ch = ‘\’ ‘;
char ch = ‘cafe’;
char ch = ‘\ucafe’;
char ch = (char) true;
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given:
1. public class returnIt (
2. returnType methodA(byte x, double y) (
3. return (short) x/y * 2;
4. )
5. )
What is the valid returnType for methodA in line 2 ?
int
double
long
short
float
Create a free account and access millions of resources
Similar Resources on Wayground
25 questions
Introduction to Java

Quiz
•
University
20 questions
java revews

Quiz
•
Professional Development
20 questions
Quiz Pemrograman Lanjut 2022/2023

Quiz
•
University
15 questions
quiz pertemuan 2 asik ddp

Quiz
•
University
15 questions
DSBS-AN-29.01.2024

Quiz
•
Professional Development
20 questions
Programming in C(1)

Quiz
•
University
15 questions
Java Basic Quizz

Quiz
•
University
20 questions
Kiểm tra lập trình C

Quiz
•
University
Popular Resources on Wayground
10 questions
SR&R 2025-2026 Practice Quiz

Quiz
•
6th - 8th Grade
30 questions
Review of Grade Level Rules WJH

Quiz
•
6th - 8th Grade
6 questions
PRIDE in the Hallways and Bathrooms

Lesson
•
12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
15 questions
Subtracting Integers

Quiz
•
7th Grade
Discover more resources for
11 questions
All about me

Quiz
•
Professional Development
10 questions
How to Email your Teacher

Quiz
•
Professional Development
15 questions
Let's Take a Poll...

Quiz
•
9th Grade - University
5 questions
Setting goals for the year

Quiz
•
Professional Development
2 questions
Pronouncing Names Correctly

Quiz
•
University
14 questions
2019 Logos

Quiz
•
Professional Development
34 questions
WH - Unit 2 Exam Review -B

Quiz
•
10th Grade - University
21 questions
Mapa países hispanohablantes

Quiz
•
1st Grade - University