LogoLearning For Everyone
Take Quiz
Contact Us
Related Topics
Related Topics
Selected Topic: All
1. What is the range of short data type in Java?
Choose the correct option:
  • a) -128 to 127

  • b) -32768 to 32767

  • c) -2147483648 to 2147483647

  • d) None of the mentioned

Short occupies 16 bits in memory. Its range is from -32768 to 32767.

2. What is the range of byte data type in Java?
Choose the correct option:
  • a) -128 to 127

  • b) -32768 to 32767

  • c) -2147483648 to 2147483647

  • d) None of the mentioned

Byte occupies 8 bits in memory. Its range is from -128 to 127.

4. An expression involving byte, int, and literal numbers is promoted to which of these?
Choose the correct option:
  • a) int

  • b) long

  • c) byte

  • d) float

An expression involving bytes, ints, shorts, literal numbers, the entire expression is promoted to int before any calculation is done.

5. Which of these literals can be contained in float data type variable?
Choose the correct option:
  • a) -1.7e+308

  • b) -3.4e+038

  • c) +1.7e+308

  • d) -3.4e+050

Range of float data type is -(3.4e38) To +(3.4e38)

6. Which data type value is returned by all transcendental math functions?
Choose the correct option:
  • a) int

  • b) float

  • c) double

  • d) long

Only double data type value is returned by all transcendental math functions. Transcendental math functions don’t return int or long. They return double instead of float as double has larger range.

Items per page: