Which of the following are legal lines of Java code?
  1. int w = (int)88

Home | Discussion Forum

Which of the following are legal lines of Java code?

  1. int w = (int)888.8;
  2. byte x = (byte)100L;
  3. long y = (byte)100;
  4. byte z = (byte)100L;

View More Related Question

1) 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);
}
}

2) What is the error in this code?

      byte b = 50;
b = b * 50;

3) Which of the following are legal lines of Java code?

  1. int w = (int)888.8;
  2. byte x = (byte)100L;
  3. long y = (byte)100;
  4. byte z = (byte)100L;

4) Which of the following automatic type conversion will be possible?

5) Which of these is necessary condition for automatic type conversion in Java?

UP Gk Online Test

taiyari24hour.com