
Java Data Types and String Manipulation

Quiz
•
Computers
•
12th Grade
•
Medium
JAYA SUDIKSHA
Used 1+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What are the four main primitive data types in Java?
char, int, long, object
int, boolean, char, double
int, float, boolean, string
float, string, byte, short
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
How do you declare a variable in Java?
variableName dataType;
dataType: variableName;
var variableName;
dataType variableName;
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the default value of a boolean variable in Java?
true
false
null
1
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Explain the difference between 'int' and 'Integer' in Java.
'int' can hold null values; 'Integer' cannot.
'int' is a reference type; 'Integer' is a primitive type.
Both 'int' and 'Integer' are the same and interchangeable.
'int' is a primitive type; 'Integer' is a wrapper class.
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the purpose of the 'final' keyword when declaring a variable?
The 'final' keyword is used to declare a variable that can hold multiple data types.
The 'final' keyword allows a variable to be reassigned multiple times.
The 'final' keyword makes a variable accessible only within its own method.
The 'final' keyword makes a variable immutable, preventing it from being reassigned after its initial assignment.
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the following code: int x = 5; System.out.println(x++);?
4
6
5
5.0
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the scope of a variable declared inside a method?
Static scope limited to the class.
Local scope within the method only.
Global scope accessible throughout the program.
Block scope only within the nearest curly braces.
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Python String

Quiz
•
12th Grade
15 questions
Programming python review

Quiz
•
9th - 12th Grade
20 questions
Computer 10 | Introduction to Java

Quiz
•
9th - 12th Grade
18 questions
Programming lesson 1 - Syntax

Quiz
•
9th Grade - University
20 questions
uCertify Chapter 1 Test

Quiz
•
9th - 12th Grade
20 questions
QUIZ DASAR DASAR PEMROGRAMAN JAVA

Quiz
•
11th Grade - University
20 questions
AP CSA Midterm Concept Review 1

Quiz
•
12th Grade
24 questions
AGAD: UNIT 4_C# & UNITY

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade