Ticker

6/recent/ticker-posts

L6, Numeric Data Types, Understanding Numeric Data Types in Java, package q10744

Numeric Data Types, Understanding Numeric Data Types in Java :-

In Java, there are different numeric data types to represent whole numbers(integral) and fractions(floating-point) of different sizes (magnitudes).


The numeric types are the integral types and the floating-point types.

The integral types are byte, short, int, and long, whose values are 8-bit16-bit32-bit and 64-bit signed two's-complement integers, respectively, and char, whose values are 16-bit unsigned integers representing UTF-16 code units (#3.1).

The floating-point types are float, whose values include the 32-bit IEEE 754 floating-point numbers, and double, whose values include the 64-bit IEEE 754 floating-point numbers.

[Source: Java Language Specification, Primitive Types and Values]

Select all the correct statements given below.

  • intshortbyte and long are floating-point types
  • char values are 16-bit integers
  • double can hold a value larger than the maximum float value
  • long can hold a value greater than the maximum int value

Post a Comment

0 Comments