
Java
Authored by Subba Chavva
Computers
University
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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)
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
25 questions
QUIZ
Quiz
•
University
25 questions
Quiz Project Management - IS
Quiz
•
University
25 questions
Understanding Input, Selection and Loops in Python
Quiz
•
7th Grade - University
25 questions
Final Exam Revision (Trial)
Quiz
•
University
25 questions
C++ with DS
Quiz
•
University
25 questions
Inter Class quizIT_23_JAN_2024
Quiz
•
University
25 questions
untitled
Quiz
•
8th Grade - University
25 questions
Logical Thinking and MS Word Quiz
Quiz
•
5th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade