JAVA development quiz 1

JAVA development quiz 1

University

10 Qs

quiz-placeholder

Similar activities

Java Lesson 5

Java Lesson 5

5th Grade - University

8 Qs

Quiz de Programação e Sustentabilidade

Quiz de Programação e Sustentabilidade

10th Grade - University

15 Qs

Praktisi Mengajar - Java Test

Praktisi Mengajar - Java Test

University

10 Qs

Java Programming Quiz

Java Programming Quiz

University

13 Qs

Java set3

Java set3

University

10 Qs

Java Set 2

Java Set 2

University

10 Qs

Prova POO

Prova POO

University

9 Qs

Java Lesson 8

Java Lesson 8

5th Grade - University

13 Qs

JAVA development quiz 1

JAVA development quiz 1

Assessment

Quiz

Other

University

Medium

Created by

Gnaneshwar Reddy

Used 3+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. What is the parent class of all classes in Java?




a) Object

b) Parent

c) Base

d) Root

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. What is the purpose of the "break" keyword in Java?




a) To terminate the program immediately.

b) To exit from a loop or switch statement.

c) To skip the current iteration of a loop.

d) To skip the current case in a switch statement.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. What is the output of the following code snippet?
    String str = "Hello";

    str.concat(" World");

    System.out.println(str);

a) Hello

b) Hello World

c) World


d) Compilation error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Which of the following statements is true about Java interfaces?




a) Interfaces can contain instance variables.

b) A class can implement multiple interfaces with the same method names.

c) Interfaces can be instantiated directly.

d) Interfaces can have constructors.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. What is the output of the following code snippet?
    String str1 = "hello";

    String str2 = "hello";

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

a) true


b) false

c) Compilation error

d) Runtime error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. What is the output of the following Java code snippet?
    public class Main {

    public static void main(String[] args) {

    int x = 5;

    System.out.println(x++); // Post-increment

    }

    }

a) 5

b) 6

c) Compilation error

d) Runtime error

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Which keyword is used to define a constant in Java?


a) constant

b) final


c) static

d) const

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?