OOPS Fundamentals

OOPS Fundamentals

University

10 Qs

quiz-placeholder

Similar activities

DEBUG THE CODE

DEBUG THE CODE

University

10 Qs

C# Cơ bản

C# Cơ bản

University

15 Qs

Milking Minds 2 17-01-24

Milking Minds 2 17-01-24

University

15 Qs

Java Fundamentals - Test 1B

Java Fundamentals - Test 1B

University

5 Qs

C Programming - Basics 001

C Programming - Basics 001

University

10 Qs

Java Bootcamp Day 4

Java Bootcamp Day 4

University

15 Qs

Java 6

Java 6

University

10 Qs

JAVA array

JAVA array

12th Grade - University

10 Qs

OOPS Fundamentals

OOPS Fundamentals

Assessment

Quiz

Computers

University

Hard

Created by

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?