Toggle Navigation
Games
Blog
Class PIN
Join for Free
Sign in
Toggle Navigation
Games
PIN
Join for Free
Blog
Pricing
Contact us
Help center
Sign in
Study
Revision 9
0
%
0
0
0
Back
Restart
If a is of type int and b is of type float what would be the resultant data type of a+b?
float
Oops!
Okay!
The _______statement is used to avoid fall through
break
Oops!
Okay!
State one similarity between while and for loop.
entry controlled loops
Oops!
Okay!
p=5 and q=19: int n = (q-p)>(p-q)?(q-p):(p-q);
14
Oops!
Okay!
Name the the types of conversion from one datatype to another
implicit & explicit
Oops!
Okay!
The __________ function of the Scanner class is used to accept a character from the user
next().charAt(0)
Oops!
Okay!
Name the primitive data type in Java that is: a single 16-bit Unicode character whose default value is ‘\u0000’
char
Oops!
Okay!
Give one point of difference between unary and binary operators.
Unary operator works on a single operand and Binary operator works on 2 operands
Oops!
Okay!
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.
Oops!
Okay!
a=30, b=50; a = a + b; b = a – b; a = a – b; Print values of a & b
50,30
Oops!
Okay!
State the difference between = and = =.
In Java, “=” is the assignment operator and “==” is a comparison operator
Oops!
Okay!
Which Scanner methods allows us to input a number with a decimal point?
nextFloat(), nextDouble()
Oops!
Okay!
y+=++y + y-- + --y; when int y=8
33
Oops!
Okay!
State the number of bytes occupied by char and int data types.
char =2 , int =4
Oops!
Okay!
int a = 63, b = 36; boolean x = (a < b ) ? true : false; int y= (a > b ) ? a : b; Print x & y
false & 63
Oops!
Okay!
double a = - 6.35; double x = Math.abs(Math.ceil(a));
6.0
Oops!
Okay!
The while loop is an exit controlled loop
false
Oops!
Okay!
The return type of cbrt( ) function is _____________.
double
Oops!
Okay!
Name two jump statements
return,break,coninue
Oops!
Okay!
double num=Math.random(0); is a valid statement.
false
Oops!
Okay!
Give Output: while(true) System.out.println('*');
* endlessly in different lines
Oops!
Okay!
Your experience on this site will be improved by allowing cookies.
Allow cookies