CS 38-Summer09_Quiz_3_Solution

CS 38-Summer09_Quiz_3_Solution - Steve Houseman Page 1...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Steve Houseman Page 1 10/5/2011 CS38-Java- Quiz # 3-Summer 2008_Solution Time allowed 30 minutes, Total = 5 points. Instruction: Please complete all 10 multiple choice questions, by marking the correct answer on Scranton (Form No. 882-E). This Quiz consists of three (3) pages. 1. If you have defined a class SavingsAccount with a public static method getNumberOfAccounts() , and created a SavingsAccount object referenced by the variable account20 , which of the following will call the getNumberOfAccounts() method? a.    account20.getNumberOfAccounts();  b .     SavingsAccount.getNumberOfAccounts(); c.    getNumberOfAccounts(); d.    None of the above, you cannot call a static method. 2. When a method’s return type is a class, what is actually returned to the calling program? a. A reference to an object of the class b. Only the values in the object that the method accessed c. An object of the class d. All of the above 3. Enumerated types have this method, which returns the position of an enum constant in the declaration list. a.    position                   b.    toString               c.    location             d.    ordinal 4. When an individual array element is passed to a method. a.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

CS 38-Summer09_Quiz_3_Solution - Steve Houseman Page 1...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online