Q. Which of the following is the correct way to declare a byte variable named myByte and initialize it to 5 in Java?

  • (A) byte myByte = 5
  • (B) byte myByte = "5"
  • (C) byte myByte = '5'
  • (D) byte myByte = 5.0
πŸ’¬ Discuss
βœ… Correct Answer: (A) byte myByte = 5
Explanation: The correct answer is Option A: byte myByte = 5.
Explanation by: Praveen Singh
The correct answer is Option A: byte myByte = 5.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
124
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Praveen Singh
Publisher
πŸ“ˆ
97%
Success Rate