Java Programming Quiz - unit 1b

Quiz
•
Information Technology (IT)
•
9th Grade
•
Medium
Wayground Content
Used 21+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Where should the import java.util.Scanner; statement be placed in a Java program?
Inside the main method
At the beginning of the program before the class declaration
At the end of the program
Anywhere in the program
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code output? String text = "Hello, Java!"; int index = text.indexOf("Java"); System.out.println(index);
7
6
5
8
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the value of y after the following statements? int y = 4; y *= 2;
2
4
6
8
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does \t represent in a string?
A tab space
A new line
A backspace
A space
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will System.out.println("Java".charAt(2)); output?
J
a
v
Throws an error
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code output? String text = "Hello, World!"; char ch = text.substring(7, 12).charAt(2); System.out.println(ch);
W
r
l
o
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What method is used to read a double value using a Scanner object?
nextDouble()
getDouble()
readDouble()
inputDouble()
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Ulangan Harian Berpikir Komputasional

Quiz
•
9th Grade
20 questions
Python Strings and Methods Quiz

Quiz
•
9th Grade
16 questions
Mastering Excel Functions

Quiz
•
9th Grade
20 questions
Quiz Algoritma dan Pemrograman

Quiz
•
9th Grade
15 questions
Python Battle Royale: Who Will Survive in the End?❤️🤔

Quiz
•
9th - 12th Grade
20 questions
Python

Quiz
•
9th - 12th Grade
25 questions
Ulangan Harian Struktur Data

Quiz
•
9th Grade - University
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
Discover more resources for Information Technology (IT)
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
12 questions
Graphing Inequalities on a Number Line

Quiz
•
9th Grade
20 questions
Cell Organelles

Quiz
•
9th Grade
28 questions
Ser vs estar

Quiz
•
9th - 12th Grade
15 questions
Two Step Equations

Quiz
•
9th Grade
17 questions
Continents and Oceans

Lesson
•
5th - 9th Grade