Peer Instruction: Unit 2 Multiple Choice QuestionsΒΆ
- "Bob"
- Incorrect! name stores the string Bob, not including the quotes.
- Bob
- Correct! Bob is stored in the variable name after the code is executed.
- The address in memory where "Bob" is stored
- Incorrect! The address in memory is not stored in the variable name. Instead, the string Bob is stored.
- new String("Bob")
- Incorrect! Bob is stored in the variable name after the code is executed, not new String("Bob")
16-6-1: What is stored in the variable name after the following line of code is executed?
String name = "Bob";
- 1-A, 2-C, 3-C, 4-D
- Incorrect! Scenario 1 creates a picture from "filename.jpg." Scenario 2 uses 'other' as the picture that it is copying. Scenario 3 uses aNum and bNum to determine the dimensions of the image. Scenario 4 uses aNum and bNum to set the width and height as the same dimensions as another image.
- 1-B, 2-B, 3-A, 4-D
- Incorrect! Scenario 1 creates a picture from "filename.jpg." Scenario 2 uses 'other' as the picture that it is copying. Scenario 3 uses aNum and bNum to determine the dimensions of the image. Scenario 4 uses aNum and bNum to set the width and height as the same dimensions as another image.
- 1-A, 2-C, 3-D, 4-D
- Incorrect! Scenario 1 creates a picture from "filename.jpg." Scenario 2 uses 'other' as the picture that it is copying. Scenario 3 uses aNum and bNum to determine the dimensions of the image. Scenario 4 uses aNum and bNum to set the width and height as the same dimensions as another image.
- 1-B, 2-C, 3-D, 4-D
- Correct! Scenario 1 creates a picture from "filename.jpg." Scenario 2 uses 'other' as the picture that it is copying. Scenario 3 uses aNum and bNum to determine the dimensions of the image. Scenario 4 uses aNum and bNum to set the width and height as the same dimensions as another image.
16-6-2: Match the scenario to the constructor call.
You have attempted of activities on this page