Search Header Logo

Quiz 1

Authored by Ms. Asst.Prof

Computers

University

Used 3+ times

Quiz 1
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

int x=5, y=20;

x+=32;

y/=4;

System.out.println("x="+x+", y="+y);

x=32, y=4

x=9, y=52

x=37, y=5

x=160, y=80

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Every Java application program must have

a class named MAIN

a method named main

comments

integer variables

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

To print "Hello, world" on the moniter, use the following Java statement

SystemOutPrintln("Hello, world");

System.out.println{"Hello, world"}

System.out.println("Hello, world");

Print "Hello, world"

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Predict the output?

final double x=99.0;

x=54.3;

System.out.println("x="+x);

x=54.3

x=99

x=153.3

Nothing, this is an error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid Java statement?

String str='John Doe';

string str="John Doe";

string str='John Doe';

String str="John Doe";

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following does not describe a valid comments in Java?

Single line comments, two forward slashes - //

Multi-line comments, start with /* and end with */

Multi-line comments, start with / and end with /

Documentation comments, starting with /** and ending with */

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements correctly creates a Scanner object for keyboard input?

Scanner kbd = new Scanner(System.keyboard);

Scanner keyboard = new Scanner(System.in);

Scanner keyboard(System.in);

Keyboard scanner =new Keyboard(System.in);

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?