Download presentation
Presentation is loading. Please wait.
Published byChristian Rice Modified over 9 years ago
1
Clicker quiz 9/3/13 CSE 1102 Fall 2013
2
Look out behind you! The picture associated with one of the instructors on Piazza includes an animal. That animal is a … A.Horse B.Dog C.Bear [correct] D.Moose E.The instructor is the only animal in the picture
3
"The iguana is green. It lives in a cage, eats lettuce leaves from a food dish, and moves around the cage." Which of the above does not describe a capability of the iguana? A. The iguana is green [correct] B. It lives in a cage C. [It] eats lettuce leaves from a food dish D. [It] moves around the cage E. None of the above
4
An object's properties are modeled in Java by using A. Constructors B. Methods C. Instance variables [correct] D. Comments E. None of the above
5
1.public class Iguana { 2. // here model the properties and capabilities 3.} In line 1 of the above code, which words are reserved words? (the line numbers do not appear in the code, just on the slide to make it clearer) A. public and class [correct] B. public and Iguana C. class and Iguana D. public, class, and Iguana E. Java does not have any reserved words
6
Clicker questions 9/3/13 CSE 1102 Fall 2013
7
1.public class FirstApp extends wheels.users.Frame { 2. private wheels.users.Ellipse _ellipse; 3. 4. public FirstApp() { 5. _ellipse = new wheels.users.Ellipse(); 6. } 7. 8. public static void main(String[] args) { 9. FirstApp app = new FirstApp(); 10. } 11.} Why is the Ellipse named _ellipse, but the FirstApp named app? A.Since Ellipse is an externally defined class we need to use the underscore. B.Since we call the FirstApp app instead of firstApp we do not need the underscore. C._ellipse is an instance variable, but app is not [correct] D._ellipse needs to be used in more than one place but app does not E._ellipse is private, but app is not
8
This UML classs diagram specifies that A.Cage is a peer object of Bowl; B.Each Iguana is contained in a Cage C.Each instance of Iguana “knows about” an instance of Cage D.An Iguana can go to a Cage or to a Bowl E.Each Bowl and Cage has an assigned Iguana
9
In the Iguana class, the instance variables are private, but the methods are public. This policy is good in general because (choose the best answer): A.You want to hide the internal state of an object from the user B.Private methods don't make sense because you cannot invoke them C.Instance variables never change, so you do not have to provide access D.It allows you to control access using methods rather than variables [correct] E.It is a convention in this text, like putting underscore at the start of an instance variable name
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.