Edit Game
Revision 9
 Delete

Use commas to add multiple tags

 Private  Unlisted  Public



 Save

Delimiter between question and answer:

Tips:

  • No column headers.
  • Each line maps to a question.
  • If the delimiter is used in a question, the question should be surrounded by double quotes: "My, question","My, answer"
  • The first answer in the multiple choice question must be the correct answer.






 Save   21  Close
Which Scanner methods allows us to input a number with a decimal point?
nextFloat(), nextDouble()
The return type of cbrt( ) function is _____________.
double
When are braces optional or necessary in conditional statements?
braces are optional for if/else in case there is only one statement to be executed.
State the difference between = and = =.
In Java, “=” is the assignment operator and “==” is a comparison operator
Give Output: while(true) System.out.println('*');
* endlessly in different lines
State one similarity between while and for loop.
entry controlled loops
a=30, b=50; a = a + b; b = a – b; a = a – b; Print values of a & b
50,30
double a = - 6.35; double x = Math.abs(Math.ceil(a));
6.0
double num=Math.random(0); is a valid statement.
false
Name two jump statements
return,break,coninue
The while loop is an exit controlled loop
false
The __________ function of the Scanner class is used to accept a character from the user
next().charAt(0)
The _______statement is used to avoid fall through
break
Name the primitive data type in Java that is: a single 16-bit Unicode character whose default value is ‘\u0000’
char
State the number of bytes occupied by char and int data types.
char =2 , int =4
int a = 63, b = 36; boolean x = (a < b ) ? true : false; int y= (a > b ) ? a : b; Print x & y
false & 63
y+=++y + y-- + --y; when int y=8
33
p=5 and q=19: int n = (q-p)>(p-q)?(q-p):(p-q);
14
Name the the types of conversion from one datatype to another
implicit & explicit
Give one point of difference between unary and binary operators.
Unary operator works on a single operand and Binary operator works on 2 operands
If a is of type int and b is of type float what would be the resultant data type of a+b?
float