
Introduction to object oriented programming
Authored by scoremaster JAVA
Computers
10th Grade

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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.
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
48 questions
ULANGAN Sistem Komputer
Quiz
•
10th Grade
50 questions
Microsoft Word Tekrar
Quiz
•
9th - 12th Grade
50 questions
Digital Media II Final Study Guide
Quiz
•
9th - 12th Grade
45 questions
BTEC Tech Award DIT - Modern Technology (Complete)
Quiz
•
10th Grade
50 questions
Câu hỏi ôn tập giữa kì 1 Tin học 10 CĐ A,B,D
Quiz
•
10th Grade
50 questions
PHOTOSHOP INTRO
Quiz
•
9th - 12th Grade
43 questions
Test próbny EE.08 (Windows OS)
Quiz
•
9th - 12th Grade
45 questions
Skills for Real World Survival
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
8 questions
2 Step Word Problems
Quiz
•
KG - University
20 questions
Comparing Fractions
Quiz
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Latin Bases claus(clois,clos, clud, clus) and ped
Quiz
•
6th - 8th Grade
22 questions
fractions
Quiz
•
3rd Grade
7 questions
The Story of Books
Quiz
•
6th - 8th Grade