
Introduction to object oriented programming

Quiz
•
Computers
•
10th Grade
•
Hard
scoremaster JAVA
FREE Resource
47 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which OOP principle means 'hiding internal details and showing only essential features'?
Encapsulation
Polymorphism
Inheritance
Abstraction
Answer explanation
The correct answer is 'Abstraction'. It refers to the OOP principle of hiding complex implementation details and exposing only the necessary features, allowing users to interact with objects without needing to understand their inner workings.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In Java, which of the following is not a primitive data type?
byte
short
String
boolean
Answer explanation
In Java, primitive data types include byte, short, and boolean. However, String is not a primitive type; it is an object that represents a sequence of characters. Therefore, the correct answer is String.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method reads an entire line of text using Scanner?
next()
nextChar()
nextLine()
readLine()
Answer explanation
The correct method to read an entire line of text using Scanner is nextLine(). The next() method reads the next token, while nextChar() and readLine() are not valid methods in the Scanner class.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The expression 17/5 in Java evaluates to:
3.4
3
3.0
4
Answer explanation
In Java, when both operands are integers, integer division is performed. Thus, 17/5 evaluates to 3, discarding the decimal part. Therefore, the correct answer is 3.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which statement about the Math class is true?
You must create a Math object to use its methods
Most methods in Math are static
Math methods require java.util import
Math.round returns double only
Answer explanation
The correct statement is that most methods in the Math class are static, allowing them to be called without creating an instance of the class. The other options are incorrect regarding object creation, imports, and return types.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In a switch statement, the 'default' case:
Must be the first case
Is optional
Must be last
Requires a break
Answer explanation
The 'default' case in a switch statement is optional, meaning it does not have to be included. It can appear anywhere, but it is not required to be the first or last case, nor does it necessarily require a break.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
System.out.print and System.out.println differ in that println:
Prints in bold
Flushes the buffer
Appends a newline
Prints to stderr
Answer explanation
System.out.println appends a newline after printing, while System.out.print does not. This means println moves the cursor to the next line, making it useful for formatting output.
Create a free account and access millions of resources
Similar Resources on Wayground
50 questions
Chapter 5 - Intro to CADD

Quiz
•
10th - 12th Grade
50 questions
KISI-KISI PAS KELAS 8 SEM GANJIL 2024-2025

Quiz
•
8th Grade - University
50 questions
LATIHAN SOAL

Quiz
•
10th Grade - University
44 questions
Multidimensional list and tuples 2025

Quiz
•
9th - 12th Grade
50 questions
PAS GASAL Sistem Komputer - X TKJ

Quiz
•
10th Grade
46 questions
Ulangkaji ASK T1 Bab 3 Algoritma

Quiz
•
1st - 12th Grade
50 questions
AI, Machine Learning, and Neural Networks

Quiz
•
9th - 12th Grade
45 questions
SAS INFORMATIKA IX SEMESTER 1

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

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
20 questions
Analog vs Digital

Quiz
•
9th - 12th Grade
10 questions
Exploring Cybersecurity Techniques and Threats

Interactive video
•
6th - 10th Grade
10 questions
Understanding the Internet and Data Transmission

Interactive video
•
7th - 12th Grade