Java Quiz set 3

Java Quiz set 3

University

15 Qs

quiz-placeholder

Similar activities

QUIZ TENGAH SEMESTER

QUIZ TENGAH SEMESTER

University

20 Qs

C++ Assesment 1

C++ Assesment 1

University

20 Qs

Java Programming-1

Java Programming-1

University

10 Qs

Bài tập trắc nghiệm C++(tiếp)

Bài tập trắc nghiệm C++(tiếp)

3rd Grade - University

10 Qs

Revision : Chapter 1

Revision : Chapter 1

University

19 Qs

YAY! Fridate with ComSSA (Network 101)

YAY! Fridate with ComSSA (Network 101)

University

20 Qs

Object Oriented Programming Assessment 1

Object Oriented Programming Assessment 1

University

15 Qs

 QUIZ  MS Core Java Quiz-3 2023

QUIZ MS Core Java Quiz-3 2023

University

11 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

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?