
Java

Quiz
•
Computers
•
University
•
Medium
Subba Chavva
Used 1+ times
FREE Resource
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a class in object-oriented programming?
A variable that holds multiple values
A type of exception handling mechanism
A blueprint for creating objects
A method that performs calculations
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does encapsulation mean in Java?
Hiding the implementation details of a class
Creating multiple instances of a class
Using class inheritance
Combining multiple classes into one
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which Java feature allows a subclass to inherit properties and behaviors from a superclass?
Encapsulation
Polymorphism
Abstraction
Inheritance
4.
FILL IN THE BLANK QUESTION
1 min • 1 pt
What is the output of the following Java program?
public class MyClass {
int x;
public MyClass(int val) {
x = val;
}
public static void main(String[] args) {
MyClass obj = new MyClass(5);
System.out.println(obj.x);
}
}
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements correctly initializes an array of integers in Java?
int[] numbers = new int[5]();
int[] numbers = new int[5];
int numbers[5];
int[] numbers = {1, 2, 3, 4, 5};
6.
FILL IN THE BLANK QUESTION
1 min • 1 pt
What is the output (value only) of the following Java program?
public class Circle {
double radius;
public Circle(double r) {
radius = r;
}
public double calculateArea() {
return Math.PI radius radius;
}
public static void main(String[] args) {
Circle c = new Circle(3.0);
System.out.println( c.calculateArea());
}
}
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you access the third element of an array named scores?
scores.get(3)
scores.third
scores[2]
scores(3)
Create a free account and access millions of resources
Similar Resources on Wayground
25 questions
JAVA WEEK 7-12

Quiz
•
University
30 questions
Coding Competation(Round 1)

Quiz
•
University
30 questions
Javascript Quiz

Quiz
•
University
31 questions
Java/ Фінальний тест

Quiz
•
9th Grade - Professio...
28 questions
Multithreading

Quiz
•
University
30 questions
BSIT 3H Quiz on Exception Handling in Java

Quiz
•
University
25 questions
Quiz BP1 - JAVA SWING

Quiz
•
University
30 questions
Java Lab

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

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

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University