Question 4: int i = 10.0; Its incorrect as by default decimal value is double and we're attempting to assign to int type which (higher byte size to lower byte size). Which will give Compile Time error as possible lossy conversion/ possible loss of precision. Hence options d is also incorrect.
For Question 18: They are reserved words (for the future use). The true false and null − True, false and null represents certain values in Java, they are used as literals. They are not considered as keywords
8 th question i got possiable lossy conversion from double to long,I think double is higher range not depending on type , class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); long a= 10; double b=20; long c=a+b; System.out.println(c); } }
Question 4:
int i = 10.0;
Its incorrect as by default decimal value is double and we're attempting to assign to int type which (higher byte size to lower byte size). Which will give Compile Time error as possible lossy conversion/ possible loss of precision.
Hence options d is also incorrect.
For Question 18: They are reserved words (for the future use). The true false and null − True, false and null represents certain values in Java, they are used as literals. They are not considered as keywords
8 th question i got possiable lossy conversion from double to long,I think double is higher range not depending on type , class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
long a= 10;
double b=20;
long c=a+b;
System.out.println(c);
}
}
I am gona share this to my friends who is preparing for the interviews.
You made me Smile :)
13 is Compilation error since we didn't end the initialization of variables with ; and S in system is not Capitalized.
Q4, option d) is not correct also because 10.0 is double and not int so , response are b) and d)
Great content. Keep it up.
Thankyou
Q.16 smile😁😁😁😍😍
Q:8---Falae
#keepgoing
Thankyou
Thanks, you know! 😆
Q8) is wrong! Type mismatch: cannot convert from double to long
Q18) also wrong !! true and false are not keywords in java.
please check
thank you again
Thank you too!
18 answer is wrong
Q. 4 float a=10; also wrong, correct is float a=(10)f;
float a=10; is correct but float a=10.0 must be incorrect;
D
A
55 more subscribers needed to earn money from this channel.
can't wait ;)