πŸ“Š JAVA
Q. What will be output of the following program code?
public class Test{
public static void main(String[] a){
short x = 10;
x = x*5;
System.out.print(x);
}
}
  • (A) 50
  • (B) 10
  • (C) Compilation Error
  • (D) None of these
πŸ’¬ Discuss
βœ… Correct Answer: (C) Compilation Error

Explanation: lossy conversion from int to short

Explanation by: Sonali Mishra
lossy conversion from int to short

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
81
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Sonali Mishra
Publisher
πŸ“ˆ
97%
Success Rate