
OOPS Fundamentals

Quiz
•
Computers
•
University
•
Hard
Dr Sridevi
Used 12+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
public class Null {
public static boolean greet() {
System.out.print("Program execute = ");
return true;
}
public static void main(String[] args) {
System.out.println(Null.greet());
}
}
Program execute = true
Program execute = false
Program execute = null
Compilation Error
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
1. class Test1 {
public static void main(String[] args)
{
int x = 20;
System.out.println(x);
}
static
{
int x = 10;
System.out.print(x + " ");
}
}
20 10
10 20
10 10
20 20
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
class Test1 {
int x = 10;
public
static void main(String[] args)
{
System.out.println(x);
}
static
{
System.out.print(x + " ");
}
}
20 10
0 10
error
10 10
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
class SamsungMobile
{
public static void main(String[] args)
{
Simple.getData();
Simple.display();
}
}
class Simple
{
static int a, b = 20;
static void getData()
{
System.out.println("a = " + a);
}
static void display()
{
System.out.println("b = " + b);
}
static
{
System.out.println("Samsung Mobile");
a = 4 * b;
}
}
Samsung Mobile
a = 80
b = 20
Samsung Mobile
a = 0
b = 20
Samsung Mobile
a = 20
b = 0
Compilation Error
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be the output of the following program?
public class Final
{
final int assign = 30;
public static void main(String[] args)
{
final int result = 20;
final int assign;
Final f = new Final();
assign = 20;
System.out.println(assign);
System.out.println(f.assign);
System.out.println(f.process(result));
}
int process(int a)
{
return a + 5;
}
}
20
30
25
20
20
25
30
30
25
Error
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
class Output
{
final static short i = 2;
public static int j = 0;
public static void main(String [] args)
{
for (int k = 0; k < 3; k++)
{
switch (k)
{
case i: System.out.print(" 0 ");
case i-1: System.out.print(" 1 ");
case i-2: System.out.print(" 2 ");
}
}
}
}
2 1 0 1 0 0
0 1 2 1 2 2
2 1 2 0 1 2
0 1 2
error
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following classes fail to compile?
class X { }
abstract class Y { }
class Z { abstract void method(); }
X
Y
Z
All classes compile
Create a free account and access millions of resources
Similar Resources on Wayground
6 questions
Java Method Overloading

Quiz
•
University
5 questions
Java Classes & Objects

Quiz
•
University
10 questions
Programming Quiz

Quiz
•
University
11 questions
SAINS KOMPUTER 1.3

Quiz
•
University
13 questions
Java Practice Quiz on Exception Handling

Quiz
•
University
10 questions
Practical Quiz1_Advanced Java Lab_BCAE0270_2023

Quiz
•
University
10 questions
Advance Java Lab MCQ

Quiz
•
University
15 questions
Round 4 - Harvest

Quiz
•
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 Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University