No student devices needed. Know more
15 questions
Which of the following is NOT a data types in java
int
String
number
double
What is right way of defining String variable?
String name = "John";
String name = "John"
String name = John;
String name "John";
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
Based on, the general rules for constructing names for variables.
Pick false statement.
Names can contain letters, digits, underscores, and dollar signs.
Names are NOT case sensitive
Reserved words (like Java keywords, such as int or String) cannot be used as names
Names can also begin with $ and _
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
Explore all questions with a free account