+3 votes
in Class 12 by kratos

(a) Write the value that will be assigned to variable x after executing the following statement:

x = 20 - 5 + 3 * 20/5;

(b) Consider the statement:

choice = 'Y';

What is the datatype of variable choice? Write a Java statement to declare the variable 'choice'.

1 Answer

+6 votes
by kratos
 
Best answer

(a) x = 3.

(b) choice is variable of char type(character type).

Declaration: char choice;

...