Quiz 1

Quiz 1

University

13 Qs

quiz-placeholder

Similar activities

Java Operators

Java Operators

University

14 Qs

Java Control Flow statements

Java Control Flow statements

University

10 Qs

javaquizvivek

javaquizvivek

University

12 Qs

OOP - Quiz

OOP - Quiz

University

15 Qs

Array Java

Array Java

University

15 Qs

Passaggio parametri

Passaggio parametri

University

9 Qs

IEEE Coding Competition

IEEE Coding Competition

University

13 Qs

Operators in Java

Operators in Java

University

14 Qs

Quiz 1

Quiz 1

Assessment

Quiz

Computers

University

Hard

Created by

Ms. Asst.Prof

Used 3+ times

FREE Resource

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);

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?