Q. What is the output of the following program?
class A{
public static void main(String args[]){
byte b;
int i = 258;
double d = 325.59;

b = (byte) i;
System.out.print(b);

i = (int) d;
System.out.print(i);

b = (byte) d;
System.out.print(b);
}
}

  • (A) 258 325 325
  • (B) 258 326 326
  • (C) 2 325 69
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (C) 2 325 69
Explanation: In the type cast
Explanation by: Rakesh Kumar
In the type cast

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
110
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Rakesh Kumar
Publisher
πŸ“ˆ
93%
Success Rate