Search Header Logo

Java check in

Authored by Rishi M

Computers

9th - 12th Grade

Used 1+ times

Java check in
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

13 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to declare an integer variable in Java?

A) int number = "5";

B) int number = 5;

C) integer number = 5;

D) num = 5;

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a primitive data type in Java?

A) boolean

B) double

C) char

D) String

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In object-oriented programming, what is a class?

A) A value assigned to a variable

B) A blueprint for creating objects

C) A type of loop

D) A Java package

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will this loop print?

for (int i = 0; i < 3; i++) {

    System.out.println(i);

}

A) 1, 2, 3

B) 0, 1, 2

C) 0, 1, 2, 3

D) 1, 2

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code print?

int x = 4;

int y = 3;

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

A) 2

B) -2

C) 10

D) 1

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In robotics code, methods like setSpeed() or stopMotor() are examples of

A) Variables

B) Classes

C) Methods

D) Packages

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax for creating a new object in Java?

A) Motor motor();

B) Motor motor = new Motor();

C) new Motor = motor();

D) create Motor motor;

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?