Search Header Logo

Java Unit 1

Authored by Gunjan Verma

Computers

University

Java Unit 1
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT an OOP principle?

Encapsulation

Abstraction

Compilation

Inheritance

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is an object in Java?

a) A variable

b) An instance of a class

c) A function

d) A primitive data type

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the main purpose of encapsulation?

a) To allow direct access to all variables

b) To hide the implementation details of a class

c) To inherit properties from another class

d) To create multiple objects

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is polymorphism in Java?

a) Multiple classes with the same name

b) Ability of a variable to hold multiple types

c) Ability of a method to behave differently based on the object calling it

d) The use of multiple objects in a program

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT a characteristic of Java?

a) Platform independent

b) Supports multiple inheritance through classes

c) Object-oriented

d) Secure

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the Java Virtual Machine (JVM)?

a) A compiler

b) A runtime environment for Java programs

c) A debugger

d) An integrated development environment

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax for a single-line comment in Java?

a) /* comment */

b) // comment

c) -- comment

d) # comment

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