Question: 1 -
Which of the following can be operands of arithmetic operators?
-
Both Numeric & Characters
-
Boolean
-
Numeric
-
Characters
Answer:
Both Numeric & Characters
Solution:
The operand of arithmetic operators can be any of numeric or character type, But not boolean.
The operand of arithmetic operators can be any of numeric or character type, But not boolean.
Question: 2 -
Which of these statements are incorrect?
-
Assignment operators run faster than their equivalent long forms
-
Assignment operators can be used only with numeric and character data type
-
None of the mentioned
-
Assignment operators are more efficiently implemented by Java run-time system than their equivalent long forms
Answer:
None of the mentioned
Solution not available.
Question: 3 -
Modulus operator, %, can be applied to which of these?
-
None of the mentioned
-
Both Integers and floating - point numbers
-
Floating - point numbers
-
Integers
Answer:
Both Integers and floating - point numbers
Solution:
Modulus operator can be applied to both integers and floating point numbers.
Modulus operator can be applied to both integers and floating point numbers.
Question: 4 -
Decrement operator, −−, decreases the value of variable by what number?
-
1
-
4
-
2
-
3
Answer:
1
Solution not available.
Question: 5 -
Can 8 byte long data type be automatically type cast to 4 byte float data type?
-
Can be true or false
-
TRUE
-
can not say
-
FALSE
Answer:
TRUE
Solution:
Both data types have different memory representation that is why 8-byte integral data type can be stored to 4-byte floating point data type.
Both data types have different memory representation that is why 8-byte integral data type can be stored to 4-byte floating point data type.