
Java Programming - Quiz 1
Authored by Shom Das
University - Professional Development
Used 49+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
20 questions
Révision HTML, CSS et JavaScript
Quiz
•
Professional Development
20 questions
C Quest 2.0
Quiz
•
University
20 questions
PHP First Internal Practical Viva
Quiz
•
University
19 questions
Quiz sobre Estructuras Selectivas en Java
Quiz
•
12th Grade - University
20 questions
Spring/Summer 2024 Lessons and Sits
Quiz
•
Professional Development
15 questions
Bazy danych (SQL)
Quiz
•
Professional Development
20 questions
Grade 7 Python Programming Quiz
Quiz
•
7th Grade - University
20 questions
Welcoming test TPAV
Quiz
•
Professional Development
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for
10 questions
How to Email your Teacher
Quiz
•
Professional Development
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
6 questions
3RD GRADE DECLARATION OF INDEPENDENCE EXIT TICKET
Quiz
•
Professional Development
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
5 questions
Poetry Interpretation
Interactive video
•
4th Grade - University
19 questions
Black History Month Trivia
Quiz
•
6th Grade - Professio...