Java Widening and Narrowing Type Conversion

double > float > long > int > char = short > byte
---- Output ------
As Double: 1.7976931348623157E308
As Float: Infinity
As Long: 9223372036854775807
As Int: -1
As Short: -1
As Byte: -1
Process finished with exit code 0
---- Output ------
double: 56.521
int: 56
Process finished with exit code 0

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store