πŸ“Š JAVA
Q. What will be output of following program?
public class Test{
public static void main(String[] args){
byte b=127;
b++;
b++;
System.out.println(b);
}
}
  • (A) 2
  • (B) 129
  • (C) -127
  • (D) -127 D. Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (C) -127

Explanation: Range of byte data in java is -128 to 127. But byte data type in java is cyclic in nature.

Explanation by: Ram Avtar Sharma
Range of byte data in java is -128 to 127. But byte data type in java is cyclic in nature.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
135
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Ram Avtar Sharma
Publisher
πŸ“ˆ
82%
Success Rate