Java Quiz set 3

Java Quiz set 3

University

15 Qs

quiz-placeholder

Similar activities

07 - Map

07 - Map

University

15 Qs

Chapter 5-1: Review Questions & Exercises

Chapter 5-1: Review Questions & Exercises

University

10 Qs

chapter 3 - Network & Security Overview

chapter 3 - Network & Security Overview

University

13 Qs

Quiz1 TAFL(module-2)2020-21

Quiz1 TAFL(module-2)2020-21

University

20 Qs

TES AWAL MODUL 2

TES AWAL MODUL 2

University

10 Qs

Quiz on Misinformation and Bias

Quiz on Misinformation and Bias

10th Grade - University

18 Qs

Round 2 for Preplacement Bootcamp

Round 2 for Preplacement Bootcamp

University

15 Qs

NACOS Kahoot Session II

NACOS Kahoot Session II

University

20 Qs

Java Quiz set 3

Java Quiz set 3

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

Shreyas Dahibavkar

FREE Resource

AI

Enhance your content in a minute

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

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

import java.io.*;

public class Main

{

public static void main(String[] args)

{

int x = 5;

int y = 2;

int z = (x++) * (--y) + (x + y);

System.out.println("The value of z is: " + z);

    }

}

13

14

12

10

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

public class Example

{

public static void main(String[] args)

{

String str1 = "Java";

String str2 = new String("Java");

System.out.println(str1 == str2);

}

}

True
False
compile time error
run time error

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which of the following is not a valid declaration of the main method in Java?

public static void main(String[] args)
public static void main(String args[])
public static void main(String[]...args)
public void main(String[] args)

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the purpose of the super keyword in Java?

To refer to the superclass object
To create an instance of a class
To access the static members of a class
To define an abstract method

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

public class Example

{

public static void main(String[] args)

{

int a = 10;

int b = 20;

int result = (a > b) ? a++ : ++b;

System.out.println(result);

}

}

11.0
10.0
21.0
20.0

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

In Java, which collection class is synchronized?

ArrayList
LinkedList
HashSet
Vector

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

public class Example

{

public static void main(String[] args)

{

int x = 5;

int y = 2;

System.out.println(x-- - --y * 2 + (x += 2));

}

}

7.0
6.0
9.0
8.0

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?

Discover more resources for Computers