Prepare for the A Level Computer Science OCR Exam with comprehensive quizzes that cover essential topics, flashcards, and detailed explanations to help you excel. Ace your exam with confidence!

Practice this question and more.


Which of the following is NOT considered a primitive data type?

  1. Character

  2. Integer

  3. String

  4. Boolean

The correct answer is: String

Primitive data types are the most basic forms of data, often provided directly by a programming language, and they typically hold a single value. In many programming languages, such as Java or C, primitive types include characters, integers, and booleans, which represent single values. In contrast, a string is considered a composite or reference data type because it represents a sequence of characters. It is not a single value but rather an object that can hold multiple values, often managed in more complex ways than primitive types. Since strings consist of one or more characters, they require a specific structure and may have methods associated with them for manipulation, further distinguishing them from primitive types. These distinctions highlight why the string is the option that does not fit into the category of primitive data types, as it encapsulates information beyond the scope of a single value.