ControlC
· Pastebin
Login
Register
ControlC
/
Create paste
Paste content
Up to 100 KB of text. BBCode formatting is supported.
Title
- optional
Content
B
I
U
S
</>
Colors ↓
Sizes ↓
Size 1
Size 2
Size 3
Size 4
Size 5
Size 6
Size 7
public class SampleConversion{\r\n\r\n public static void main(String[]args){\r\n //upcasting float literal to double\r\n double doubleVar = 5.55f;\r\n System.out.println(doubleVar);\r\n \r\n //converting double literal to float\r\n //Just like other primitive types,\r\n //downcasting double to float can\r\n //cause data loss if the double\r\n //value that is gonna be casted exceeds\r\n //the bit range of float. Double is\r\n //64bits whereas float is 32bits\r\n float floatVar = (float)200.598333d;\r\n System.out.println(floatVar);\r\n }\r\n}
Password
Anyone with the link will still need this password to view.
Expires
1 hour
3 hours
6 hours
12 hours
24 hours
48 hours
72 hours
Sign in to enable "Never expires".
Create paste
Please verify you are human
Cancel