How many numeric data types are supported in Java?

Options
- 8
- 4
- 2
- 6


CORRECT ANSWER : 6

Discussion Board
byte,int,short,long,float,double

09666297706

veera reddy 02-20-2019 04:11 AM

data type

answer should be 8 u have missed char and boolean

nishant 07-17-2018 11:29 PM

more

how about char and bool/boolean?

daniel 03-6-2016 11:27 PM

Numeric types

There are six numeric data types four integer and two floating point:

byte 1 byte -128 to -127
short 2 bytes -32,768 to 32,767
int 4 bytes -2,147,483,648 to 2,147,483,647
long 8 bytes -9,223,372,036,854,775,808 to 9,223,372,036,854,775,80
float 4 bytes 7 decimal digits
double 8 bytes 16 decimal digits

These are also called as primitive data types and the most common primitive data type in computer language is number. The number can be used with everything from variable to classes and methods. It can be available in different formats. The following form is used to declare a variable:

type variable = initial value;

where the initial value is optional.

For example:

int myInteger=100;

or

int myInteger;

Rohit Sharma 07-30-2014 09:17 AM

numeric data types in java

byte, int short, long, float, double

Sumalatha 08-20-2013 05:03 AM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement