Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Conversion {
- public static void main(String[]args){
- byte b;
- int i = 257;
- double d = 456.789;
- System.out.println("\n conversion of int to byte.");
- b = (byte) i;
- System.out.println("i and b "+ i +" "+b);
- System.out.println("\n conversion of double to int.");
- i = (int) d;
- System.out.println(" d and i "+ d +" "+i);
- System.out.println(" \n conversion of double to byte.");
- b = (byte) d;
- System.out.println(" d and b "+ d +" "+b);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement