Peer Instruction: Using Objects Multiple Choice QuestionsΒΆ
- Type, method/message name, parameter list
- Incorrect. A type can refer to an integer, string, array, or similar data type, but that is not what is being referenced in this answer
- Class, method/message name, parameter list
- Incorrect. Turtle is the class in this example, but we are not calling the class itself in line 2.
- Object, method/message name, parameter list
- Correct. turtle1 is created using the Turtle() constructor, and is an object of the Turtle class
16-6-1: What are the components of the second line of code?
Turtle turtel1 = new Turtle();
turtle1.turn(-45);
You have attempted of activities on this page