adplus-dvertising
frame-decoration

Question

What is the output of this program?
    class conversion 
    {
        public static void main(String args[]) 
        {
            double a = 295.04;
            int  b = 300;
            byte c = (byte) a;
            byte d = (byte) b;
            System.out.println(c + " "  + d);
        } 
    }

a.

38 43

b.

39 44

c.

295 300

d.

295.04 300

Posted under Java Programming

Answer: (b).39 44

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?