Search Header Logo

Java quiz 1

Authored by Saurabh Pandey

Computers

Professional Development

Java quiz 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

1 min • 1 pt

Number of primitive data types in Java are?

6

7

8

9

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the size of float and double in java?

32 and 64

32 and 32

64 and 64

6 and 32

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following option leads to the portability and security of Java?

  1. Bytecode is executed by JVM

  1. The applet makes the Java code secure and portable

  1. Use of exception handling

  1. Dynamic binding between objects

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is not a Java features?

  1. Dynamic

  1. Architecture Neutral

  1. Use of pointers

  1. Object-oriented

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Evaluate the following Java expression, if x=3, y=5, and z=10:

++z + y - y + z + x++

24

23

20

25

Answer explanation

In the above expression, ++z means that the value will first increment by 1, i.e. 12. Now, evaluate the statement by putting the values of x, y, and z. On evaluating the expression, we get 25, as shown below.

++z +y -y +z + x++
11 + 5 - 5 + 11 + 3 = 25

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following for loop declaration is not valid?

  1. for ( int i = 99; i >= 0; i / 9 )

  1. for ( int i = 7; i <= 77; i += 7 )

  1. for ( int i = 20; i >= 2; - -i )

  1. for ( int i = 2; i <= 20; i = 2* i )

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

When an array is passed to a method, what does the method receive?

The reference of the array

The copy of the array

Length of the array

Copy of first element

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?