Java Quiz set 3

Java Quiz set 3

University

15 Qs

quiz-placeholder

Similar activities

QUIZ PBO R5I

QUIZ PBO R5I

University

10 Qs

Trắc nghiệm kiến thức Java Core - Phần I

Trắc nghiệm kiến thức Java Core - Phần I

University

15 Qs

Latihan1

Latihan1

University

10 Qs

Java Quiz2

Java Quiz2

University

11 Qs

PROGRAMMING CAMP

PROGRAMMING CAMP

University

20 Qs

Java - meeting 1

Java - meeting 1

University

10 Qs

OOPs Quiz

OOPs Quiz

University

10 Qs

OOPS MOCK QUIZ

OOPS MOCK QUIZ

University

10 Qs

Java Quiz set 3

Java Quiz set 3

Assessment

Quiz

Computers

University

Hard

Created by

Shreyas Dahibavkar

FREE Resource

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
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?