Search Header Logo

Java Programming - Set 1

Authored by Raphael Kenyuri

Computers

University

Java Programming - Set 1
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the Scanner class?

To read input from the console

To perform console output

To declare variables

To compute area

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax for declaring a constant in Java?

final datatype CONSTANTNAME = value;

datatype variableName;

Scanner input = new Scanner(System.in);

Math.pow(a, b)

3.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

Which of the following is a valid identifier in Java?

2A

readDouble

MAX_VALUE

4#R

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of 5 / 2 in Java?

2

2.5

2.0

2.25

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the range of the byte data type in Java?

-128 to 127

-32768 to 32767

-2147483648 to 2147483647

-9223372036854775808 to 9223372036854775807

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the remainder when 20 is divided by 3?

0

1

2

3

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of Math.pow(2, 3)?

2

3

8

6

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