Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. class TypeCasting
  2. {
  3. public static void main (String[]args)
  4. {
  5. byte a=125;
  6. short b=a;
  7. int c=b;
  8. long d=c;
  9.  
  10. long e=76;
  11. int f=(int)e;
  12. short g=(short)f;
  13. byte h=(byte)g;
  14.  
  15. System.out.println(a);
  16. System.out.println(b);
  17. System.out.println(c);
  18. System.out.println(d);
  19.  
  20. System.out.println(e);
  21. System.out.println(f);
  22. System.out.println(g);
  23. System.out.println(h);
  24.  
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement