Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. class TypeCasting1
  2. {
  3. public static void main(String[]args)
  4. {
  5. float a=12.35f;
  6. double b=(double)a;
  7.  
  8. double d=123.456789;
  9. float c=(float)d;
  10.  
  11. float e=51.34f;
  12. int g=(int)e;
  13.  
  14. int p=54;
  15. float q=(float)p;
  16.  
  17.  
  18. System.out.println(b);
  19. System.out.println(c);
  20. System.out.println(g);
  21. System.out.println(q);
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement