CompTIA ITF+ (FC0-U61) — Question 31
Which of the following data types should a developer use when creating a variable to hold a postal code?
Answer options
- A. Integer
- B. String
- C. Float
- D. Boolean
Correct answer: B
Explanation
The correct answer is B, String, because postal codes can include leading zeros and may contain letters or special characters, which are not suitable for numeric types like Integer or Float. Boolean is irrelevant in this context as it only represents true or false values.