-1
Float f = 123456789F

Output of float

Float = 1.234568E+08

Output shown while converting to

Int = 123456792

Long = 123456792 

D = 123456792

String = 1.234568E+08
Muzzamil
  • 2,823
  • 2
  • 11
  • 23
zareen
  • 103
  • 1
  • 1
  • 9

1 Answers1

0
  • Float is number with a decimal point from -3.402823e38 to 3.402823e38
  • Int is an integer from -2,147,483,648 to 2,147,483,647
  • Long is like int, but it has more space to use (from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807)
  • String is stored like a text, not the actuall number.
  • Yes, but int can store 123456789, but while converting same number from float, its showing different digit in the end. – zareen Jan 11 '20 at 18:31