OOAD Quiz 4

OOAD Quiz 4

University

11 Qs

quiz-placeholder

Similar activities

Mollusks

Mollusks

10th Grade - University

10 Qs

LESSON 4: MY ROOM

LESSON 4: MY ROOM

University

12 Qs

External Lab AMC-105

External Lab AMC-105

University

12 Qs

Rebrand Crossword

Rebrand Crossword

University

16 Qs

Pre-test Module 1 (F) - 2025

Pre-test Module 1 (F) - 2025

University

10 Qs

FRONT OFFICE OPERATIONS II

FRONT OFFICE OPERATIONS II

University

12 Qs

Beginning of the term quiz

Beginning of the term quiz

University

10 Qs

Total Physical Response

Total Physical Response

University

10 Qs

OOAD Quiz 4

OOAD Quiz 4

Assessment

Quiz

Education

University

Practice Problem

Medium

Created by

Dr. Pal

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

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

11 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?

public class DataTypeQuiz {

public static void main(String[] args) {

int x = 5;

int y = 10;

int result = (x++ y--) - (--x ++y);

System.out.println(result);

}

}

0

25

30

20

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the default value of a 'char' variable in Java?

'0'

'\u0000'

' ' (space)

'null'

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?

public class ArrayQuiz {

public static void main(String[] args) {

int[] numbers = new int[5];

System.out.println(numbers[2]);

}

}

0

2

garbage value

null

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT a valid Java array declaration?

int[] numbers = new int[5];

int[] numbers = {1, 2, 3, 4, 5};

int numbers[] = new int[5];

int numbers[5];

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?

public class OperatorQuiz {

public static void main(String[] args) {

int x = 5;

int y = 10;

int z = x++ + ++y;

System.out.println("z = " + z);

System.out.println("x = " + x);

System.out.println("y = " + y);

}

}

z = 16, x = 6, y = 11

z = 15, x = 5, y = 11

z = 16, x = 6, y = 10

z = 15, x = 6, y = 10

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code?

public class ControlFlowQuiz {

public static void main(String[] args) {

int x = 5;

int y = 10;

if (x != 5 && y > 5) {

System.out.println("Condition is true");

} else {

System.out.println("Condition is false");

}

}

}

Condition is true

Condition is false

Compilation error

Runtime error

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?

public class OperatorQuiz {

public static void main(String[] args) {

int x = 5;

int y = 10;

int result = x * y / (x + y);

System.out.println("Result: " + result);

}

}

Result: 2

Result: 3

Result: 0

Result: 1

Create a free account and access millions of resources

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?