Easy Tutorial
For Competitive Exams

Java Programming

1497.Which of the following can be operands of arithmetic operators?
Numeric
Boolean
Characters
Both Numeric & Characters
1498.Modulus operator, %, can be applied to which of these?
Integers
Floating – point numbers
Both Integers and floating – point numbers.
None of the mentioned
1499.With x = 0, which of the following are legal lines of Java code for changing the value of x to 1?
1. x++;
2. x = x + 1;
3. x += 1;
4. x =+ 1;
1, 2 & 3
1 & 4
1, 2, 3 & 4
3 & 2
1500.Decrement operator, –, decreases value of variable by what number?
1
2
3
4
1501.Which of these statements are incorrect?
Assignment operators are more efficiently implemented by Java run-time system than their equivalent long forms.
Assignment operators run faster than their equivalent long forms.
Assignment operators can be used only with numeric and character data type.
None
1502.What should be expression1 evaluate to in using ternary operator as in this line?
expression1 ? expression2 : expression3
Integer
Floating – point numbers
Boolean
None of the mentioned
1503.What is the value stored in x in following lines of code?
int x, y, z;
x = 0;
y = 1;
x = y = z = 8;
0
1
9
8
1504.What is the order of precedence (highest to lowest) of following operators?
1. &
2. ^
3. ?:
1 -> 2 -> 3
2 -> 1 -> 3
3 -> 2 -> 1
2 -> 3 -> 1
1505.Which of these statements are incorrect?
Equal to operator has least precedence.
Brackets () have highest precedence.
Division operator, /, has higher precedence than multiplication operator.
Addition operator, +, and subtraction operator have equal precedence.
1506.What is the output of relational operators?
Integer
Boolean
Characters
Double
1507.Evaluate the value of the expression? 6 - 2 + 10 % 4 + 7
10
12
13
14
1508.Which of the following assignment operator does not exist in Java?
>>
%=
>>>
<<<
1509.What is/are highest order precedence operator(s) in Java?
( )
{ }
both a and b
None of these
1510.The order of precedence from highest to lowest is :
&&, /, |,{}
%, <=, &&, =
<, !, ==, ++
+, -, [], !=
1511.The && and || operators
Combine two numeric values
Compare two boolean values
Combine two boolean values
Compare two boolean values
Share with Friends