Q:

What output will the following code produce?

0

What output will the following code produce?

double x = 5.5;
int y = (int)x;
System.out.println("x is " + x + " and y is " + y);

  1. x is 5 and y is 6
  2. x is 6.0 and y is 6.0
  3. x is 5.5 and y is 5
  4. x is 5.5 and y is 5.0

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

C. x is 5.5 and y is 5

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now