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.
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?
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.
Very informative video sir....it really helped me for my next test.....❤
All the best
Thankyou sir 🎉😊@@ThinkComputer
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?
Depends on if conditions. There are 3 if conditions and 2 else conditions. So, the first if condition doesn't have else.
Thank you very much sir. It really helped for my upcoming test.
Welcome
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
After string " " its concatenation, not addition.