MCQ
Single Best Answer
Easy
QThe size of '\n' is:
ID: #24253
ICSE Computer Application - Class X - 2025 SPECIMEN QUESTION PAPER
35 views
Question Info
#24253Q ID
EasyDifficulty
ICSE Computer Application - Class X - 2025 SPECIMEN QUESTION PAPERTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer: Option A
Explanation
Step 1: What is '\n' in Java?
-
'\n'is a character literal → newline character. -
In Java, every character is stored in
chartype.
Step 2: Size of char in Java
-
Unlike C/C++, where
charis 1 byte, -
In Java,
charis always 2 bytes (16 bits) because Java uses Unicode.
Step 3: Therefore
-
'\n'is simply a char, so its size = 2 bytes.
✅ Answer: (a) 2 bytes
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic