Java mock test 1 assesses knowledge of Java programming fundamentals, including data types, operators, and comparison of string objects. It is designed for learners to validate their understanding and readiness in Java, focusing on key concepts and syntax accuracy.
8 bits
16 bits
32 bits
64 bits
Rate this question:
If
Then
Goto
While
Case
Rate this question:
True
False
Rate this question:
“equal” is printed, “s3 eq s4” is printed.
“equal” is printed only.
“s3 eq s4” is printed only.
Nothing is printed.
Rate this question:
The && operator is equivalent to &2.
The && operator always evaluates both operands.
The && operator is equivalent to &*2.
The && operator does not evaluate its second operand if the value of the first operand is false.
Rate this question:
3
4
5
Error
Rate this question:
The >> operator shifts left and the >>> operator shifts right.
The >> operator shifts right and the >>> operator shifts left.
The >> operator fills the shifted out high order bits based on the sign bit and the >>> operator fills the high order bits with zeros.
The >>> operator fills the shifted out high order bits based on the sign bit and the >>> operator fills the high order bits with zeros.
Rate this question:
S3=s1 + s2;
s3=s1-s2;
s3=s1 & s2;
s3=s1 && s2
Rate this question:
Cannot be initialized before invoking any constructor
Accessible anywhere in the class
Static variables are initialized at class load time
Cannot have the same name as the class
Rate this question:
System.out.println(Math.floor(-4.7));
System.out.println(Math.round(-4.7));
System.out.println(Math.ceil(-4.7));
System.out.println(Math.min(-4.7));
Rate this question:
True
False
Rate this question:
The instanceof operator is a binary operator that determines whether an object reference is an instance of the class, interface, or array type specified by the right operand.
The instanceof operator can be used with primitive types.
The instanceof operator returns a boolean value of true if the left operand references a non-null object of class
The instanceof operator returns false if none of the preceding conditions are met or if the left operand is null.
Rate this question:
Int
Float
Boolean
Double
Rate this question:
True
False
Rate this question:
It is automatically initialized to some garbage value
It throws a compile time error
Shows run time error
Returns a null value to the variable
Rate this question:
True
False
Rate this question:
True
False
Rate this question:
Name
Null
_sum
2sqrt
Count number
Rate this question:
2variable
Variable2
_whatavariable
_3_
$anothervar
#myvar
Rate this question:
Keyword
Method
Literal
Identifier
Rate this question:
True
False
Rate this question:
8 bits
16 bits
32 bits
64 bits
Rate this question:
J=i
J=i
J=i
J=i
Rate this question:
Any number of variables can be declared in a Type declaration statement.
Different types of variables can be declared in a single Type declaration statement
The list of variables in a Type declaration statement should be separated by commas.
The Type declaration statement can be used to declare as well as initialize a variable.
Rate this question:
True
False
Rate this question:
True
False
Rate this question:
True
False
++
?:
&&
=
Rate this question:
It can be used instead of equals()
To compare two primitives, use the == operator.
To see if two references are the same,
To assign a value to the variable
Rate this question:
Quiz Review Timeline (Updated): Dec 14, 2023 +
Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.
Wait!
Here's an interesting quiz for you.