x
Info
x
Warning
x
Danger
 / 
 / 
 / 
11.Character literals enclosed in _____; string literals enclosed in _____. a.single

Question : 11.Character literals enclosed in _____; string literals enclosed in _____. a.single : 2007983

11.Character literals are enclosed in _____; string literals are enclosed in _____.

a.single quotes; single quotes

b.double quotes; double quotes

c.single quotes; double quotes

d.double quotes; single quotes

12.What is the result of the following expression?

10 + 5 * 3 - 20

a.-5

b.5

c.25

d.-50

13.What is the result of the following expression?

25 / 4 + 4 * 10 % 3

a.19

b.5.25

c.3

d.7

14.What will be displayed as a result of executing the following code?

int x = 5, y = 20;

x += 32;

y /= 4;

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

a.x = 32, y = 4

b.x = 9, y = 52

c.x = 37, y = 5

d.x = 160, y = 80

15.What will be the value of z as a result of executing the following code?

int x = 5, y = 28;

float z;

z = (float) (y / x);

a.5.60

b.5.6

c.3.0

d.5.0

16.What will be the displayed when the following code is executed?

final int x = 22, y = 4;

y += x;

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

", y = " + y);

a.x = 22, y = 4

b.x = 22, y = 26

c.x = 22, y = 88

d.Nothing, this is an error

17.In the following Java statement what value is stored in the variable name?

String name = "John Doe";

a.John Doe

b.The memory address where "John Doe" is located

c.name

d.The memory address where name is located

18.What will be displayed as a result of executing the following code?

int x = 6;

String msg = "I am enjoying this class.";

String msg1 = msg.toUpperCase();

String msg2 = msg.toLowerCase();

char ltr = msg.charAt(x);

int strSize = msg.length();

System.out.println(msg);

System.out.println(msg1);

System.out.println(msg2);

System.out.println("Character at index x = " +

ltr);

System.out.println("msg has " + strSize +

"characters.");

a.I am enjoying this class.

I AM ENJOYING THIS CLASS.

i am enjoying this class.

Character at index x = e

msg has 24 characters.

b.I am enjoying this class.

I AM ENJOYING THIS CLASS.

i am enjoying this class.

Character at index x = e

msg has 25 characters.

c.I am enjoying this class.

I AM ENJOYING THIS CLASS.

i am enjoying this class.

Character at index x = n

msg has 24 characters.

d.I am enjoying this class.

I AM ENJOYING THIS CLASS.

i am enjoying this class.

Character at index x = n

msg has 25characters.

19.What will be displayed as a result of executing the following code?

public class test

{

public static void main(String[] args)

{

int value1 = 9;

System.out.println(value1);

int value2 = 45;

System.out.println(value2);

System.out.println(value3);

value = 16;

}

}

a.9

45

16

b.94516

c.9 45 16

d.Nothing, this is an error

20.Which of the following is not a valid comment statement?

a.// comment 1

b./* comment 2 */

c.*/ comment 3 /*

d./** comment 4 */

Solution
5 (1 Ratings )

Solved
Computer Science 2 Years Ago 142 Views
This Question has Been Answered!
Unlimited Access Free
Explore More than 2 Million+
  • Textbook Solutions
  • Flashcards
  • Homework Answers
  • Documents
Signup for Instant Access!
Ask an Expert
Our Experts can answer your tough homework and study questions
154368 Computer Science Questions Answered!
Post a Question