Values and Types


Available Answers

  1. 1.

    What do you mean by type conversion? How is implicit conversion different from explicit conversion?

  2. 2.

    What will be the output of the following code segment?

    char x = 'A'; int m;
    m = (x == 'a') ? 'A' : 'a';
    System.out.println("m=" + m);

  3. 3.

    What will be following function return when executed?

    1.  Math.max(-17,-19)
    2.  Math.ceil(7.8)
  4. 4.

    What will be the output of the following code?

    double b = -15.6;
    double a = Math.rint(Math.abs(b));
    System.out.println("a=" + a);

  5. 5.

    Give one example each of a primitive data type and composite data type.

  6. 6.

    Give the output of the following program segment:

    double x = 2.9, y = 2.5;
    System.out.println(Math.min(Math.floor(x), y));
    System.out.println(Math.max(Math.ceil(x), y));

24 more answer(s) available.

Please login to post your comments.