OOPS Fundamentals

OOPS Fundamentals

University

10 Qs

quiz-placeholder

Similar activities

Listen in Python

Listen in Python

University

10 Qs

Chap 1: What is a program made of?

Chap 1: What is a program made of?

University

13 Qs

21CSC305P - Machnine Learning - Quiz

21CSC305P - Machnine Learning - Quiz

University

15 Qs

Webinar Quiz

Webinar Quiz

University

13 Qs

cp06-01-1D-Array

cp06-01-1D-Array

University

10 Qs

Kuis Dadakan ;)

Kuis Dadakan ;)

10th Grade - University

15 Qs

Topic 4-2: Multiple if-else and switch-case

Topic 4-2: Multiple if-else and switch-case

University

10 Qs

1-基本数据类型

1-基本数据类型

University

10 Qs

OOPS Fundamentals

OOPS Fundamentals

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

Dr Sridevi

Used 12+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?