Test Series - java

Test Number 7/64

Q: What is the size of a LONG integer in Java?
A. 2 bytes
B. 4 bytes
C. 8 bytes
D. 16 bytes
Solution: Range: -9223372036854775808 and 9223372036854775807.
Q: What is the size of an INT integer in Java?
A. 2 bytes
B. 4 bytes
C. 6 bytes
D. 8 bytes
Solution: Number range is -2147483648 and 2147483647.
Q: What is the size of a FLOAT floating point number in Java?
A. 2 bytes
B. 4 bytes
C. 6 bytes
D. 8 bytes
Solution: Number range is ±3.40282347E+38F
Q: What is the size of a DOUBLE floating point number in Java?
A. 4 bytes
B. 6 bytes
C. 8 bytes
D. 16 bytes
Solution: Number range is ±1.79769313486231570E+308.
Q: What is the size of a CHAR data type constant in Java?
A. 1 byte
B. 2 bytes
C. 4 bytes
D. 6 bytes
Solution: no solution
Q: What is the size of a boolean data type constant in Java?
A. 1 bit
B. 4 bits
C. 8 bits
D. Not documented well
Solution: A boolean value can hold only one bit of information. But the size of a boolean constant in memory is not defined clearly anywhere. It is machine dependent. It may be 4 bytes or so.
Q: What is the IEEE standard adopted to represent Floating point numbers in Java?
A. IEEE 9000
B. IEEE 800
C. IEEE 754
D. IEEE 512
Solution: IEEE stands for Institute of Electrical and Electronics Engineers. Original specifications were defined in the year 1985. The current version includes improvements or corrections done in the year 2008.
Q: What is the character encoding standard used in Java language?
A. ASCII
B. Unicode
C. Hexacode
D. Bytecode
Solution: Unicode takes 2 Bytes of memory to represent all characters of all languages.
Q: What is the abbreviation of ASCII?
A. American Standard Characters for Information Interchange
B. Australian Standard Code for Information Interchange
C. American Standard Code for Information Interchange
D. None of the above
Solution: ASCII can represent only the English Alphabets and a few special symbols.
Q: Choose the right statement about Java Data types.
A. Integer data types are short, int and long
B. Real number data types are float and double
C. The character data type is char.
D. All the above
Solution: no solution

You Have Score    /10