Worksheetstype conversion
Total questions: 22
Worksheet time: 20mins
Java character set consists of
Letters
Digits
Operators
Delimiters
All of the above
________________ is an American standard coding system that is represented in 7 binary bits.
ISO
IEC
UNICODE
ASCII
Non Graphic characters which are used as commands to direct the cursor while printing is known as _________________
Operators
Escape Sequence
Delimiters
Digits
float myFloatNum = 5.99f;
System.out.println(myFloatNum);
What will be the output?
5.99
5.99f
"5.99"
"5.99"f
int x = 5;
int y = 6
int z = 50;
System.out.println(x + y + z);
What will be the output?
61
5650
66
x + y + z
Which of the following is NOT a NON-primitive data type
String
Array
double
class
which of the following is NOT a primitive data type?
byte
array
char
boolean
Which of the following is the right way of defining char variable?
char myGrade = 'B';
char myGrade = "B";
char myGrade 'B';
char myGrade = "B"
int sum1 = 100 + 50;
int sum2 = sum1 + 250;
int sum3 = sum2 + sum2;
System.out.println(sum3);
What will be the final output?
950
800
sum2sum2
sum1250
Which of the following is assignment operator?
==
=
=+
++
int x = 10;
x = x + 5;
System.out.println(x);
What will be the output?
15
5
55
x5
x /= 3
Which of the below statements matches with above statement?
x = 3 / x
x = x / 3
x / 3
x /x = 3
int x = 4;
System.out.println(x < 5 && x < 10);
What will be the output?
false
true
4
x < 5 && x < 10
int x = 4.4;
int y = 5.5;
System.out.println(x == y);
What will be the output?
4.4
true
false
5.5
What is the output of below code?
int x = 5;
System.out.println(x++);
System.out.println(x);
5
5
6
6
5
6
6
5
What would the new value of A be?
A=1;
a++;
1
2
3
4
What would the new value of A be?
A=1;
A--;
0
1
2
-1
What's the value of below?
int i=5;
System.out.println(i++);
System.out.println(i);
System.out.println(++i);
5
6
7
6
6
7
6
7
8
5
5
6
++i and i++ cannot be used anywhere for the same purpose
true
false
What does the following code output?
int x = 1;
System.out.println(x++);
1
2
compilation error
runtime error
Which statement(s) are equivalent to i = i + 1?
i += 1
i++
i -= 1
i--
else x--;
else if (x < 0) x--;
if (x < 0) x--;
else x = 0;
else x++;
x--;
