Question
Which of the following container types has a fixed length?
Group of answer choices
Vector
String
Array
Constant
Group of answer choices
Vector
String
Array
Constant
Answers
GPT-4o mini
Among the container types listed, the **Array** has a fixed length. In most programming languages, once an array is created, its size cannot be changed.
- **Vector:** Typically allows dynamic resizing (can grow or shrink).
- **String:** Usually allows modifications and can vary in length (especially in languages like Python).
- **Constant:** Refers to a value that cannot change but is not a container in itself.
Thus, the correct answer is **Array**.
- **Vector:** Typically allows dynamic resizing (can grow or shrink).
- **String:** Usually allows modifications and can vary in length (especially in languages like Python).
- **Constant:** Refers to a value that cannot change but is not a container in itself.
Thus, the correct answer is **Array**.