Search Header Logo

Java Foundation 6

Authored by Rukumani CT_PG

Computers

Professional Development

Used 10+ times

Java Foundation 6
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which statement about access modifiers is correct?

An instance variable can be declared with the static modifier.

A local variable can be declared with the final modifier.

An abstract method can be declared with the private modifier.

An inner class cannot be declared with the public modifier.

An interface can be declared with the protected modifier.

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

java /code/a/Test.java

javac –d /code /code/a/Tes

java /code/a/Test.java /code/b/Best.java

java –cp /code a.Test

javac –d /code /code/a/Test.java /code/b/Best.java

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which interface in the java.util.function package can return a primitive type?

ToDoubleFunction

Supplier

BiFunction

LongConsumer

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

I am an object array

The compilation fails due to an error in line 1.

I am an array

I am an object

5.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

42

17

The compilation fails due to an error in line 4.

The compilation fails due to an error in line 3.

The compilation fails due to an error in line 2.

6.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

float z = (float)(Math.round((float)x/y*100)/100)

float z = Math.round((int)(x/y),2);

float z = Math.round((float)x/y,2);

float z = Math.round((float)x/y*100)/(float)100;

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

0). one

It creates an infinite loop printing:0). one1). two1). two...

0). one1). two2). three

The compilation fails.

A java.lang.NullPointerException is thrown.

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?