Due: Friday, October 7, 2016, 10:00 am (start of the class)

Consider the following Java program,

1    class conversion {
2	
3        public static void main(String args[]) {
4            double a = 295.04;
5            int  b = 300;
6            byte c = (byte) a;
7            byte d = (byte) b;
8            System.out.println(c + " "  + d);
9        } 
10    }

and answer following questions.

  1. What is the output of this program?
  2. Why do we get this output?

© 2016 Ying Li. Page last modified: .