Output Questions (SET 6) | Java | Java Basics, Conditional programming | ThinkComputer

Поділитися
Вставка
  • Опубліковано 1 січ 2025

КОМЕНТАРІ • 10

  • @ThinkComputer
    @ThinkComputer  5 місяців тому +7

    Many have asked this question so read this.
    In Question No. 15
    System.out.println((++a % 10 > 3) ? (ch='A') : (a='9'));
    this line prints 65 instead of A because there is a rule while says if any one of the operand either operand 2 or 3 will have numeric variable and the other one is character variable then output will come in numeric form only (i.e. ASCII code, in case of character). This is implicit type conversion done by Java language compiler.

  • @Rajdeep460
    @Rajdeep460 5 місяців тому +8

    Very informative video sir....it really helped me for my next test.....❤

    • @ThinkComputer
      @ThinkComputer  5 місяців тому +4

      All the best

    • @Rajdeep460
      @Rajdeep460 5 місяців тому

      Thankyou sir 🎉😊​@@ThinkComputer

  • @I8971jnnam
    @I8971jnnam 5 місяців тому +1

    1:40 In question 5 after the last else there are two statements
    System.out.println("Ok"+x);
    System.out.println(x);
    But in the output the ans is only -4 that is the 2nd statement so why didn't the first statement get printed?

    • @ThinkComputer
      @ThinkComputer  5 місяців тому

      Depends on if conditions. There are 3 if conditions and 2 else conditions. So, the first if condition doesn't have else.

  • @RohitKumar-s5r2n
    @RohitKumar-s5r2n 5 місяців тому

    Thank you very much sir. It really helped for my upcoming test.

  • @PhoenixFury_18
    @PhoenixFury_18 5 місяців тому

    Sir in question 8 the last print statement the last operation a+c will be 15.25
    but sir in the output you have written 105.25

    • @ThinkComputer
      @ThinkComputer  5 місяців тому

      After string " " its concatenation, not addition.