Exam-style question
Try this first
Which statement about first-class objects is correct?.
- A.Only functions can be first-class objects
- B.First-class objects may appear in expressions
- C.First-class objects cannot be assigned to variables
- D.First-class objects must always be floating-point values
Answer and explanation
Concise answer
First-class objects cannot be assigned to variables
Why this is correct
The specification states that first-class objects or values may appear in expressions. It also gives integers, floating-point values, characters and strings as examples in many languages.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
