MC Exam1st Semester - APCSFinalExam,1stsemester True-False...

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

View Full Document Right Arrow Icon
APCS Final Exam, 1 st  semester True-False 1. In Java, some methods may be defined outside of all classes. 2. A class’ constructor can call that class’s methods. 3. You must construct at least one instance of a class to use the class’s static methods. 4. Constructors never return any values. 5. Literal strings are objects of the String type. 6. If the return type of a method is a class, the method returns a reference to an object of that class. 7. A void method must have at least one return . 8. The order of a method’s arguments is important only when they have the same type. 9. The Arrays class belongs to the java.util package. 10. Arrays has overloaded methods for sorting an array of integers, doubles, or strings. 11. Arrays uses the Selection Sort algorithm for sorting. 12. Arrays has overloaded methods for filling the elements of an array with a given value. 13. All methods in the Arrays class are static. 14. Only static fields can be declared “final.” 15. A field in a class may be public or private, but usually all fields are declared private. 16. A local variable may be initialized in one method or constructor and used in another method. 17. A Boolean variable can only have values true or false. 18. Declarations of fields must be placed at the top of the class, before all the constructors and methods. 19. When an (int) cast is applied to a double value, it rounds the value to the nearest integer. 20. Logical operators apply only to Boolean variables or expressions. 21. Given int n = 2, b = 3; double x = 2.5, y; what is the result from the following statement? y = (x * n + b / n) / 2; A. y = 2.0 B. y = 3.0 C. y = 3.25 D. Error message E. None of the above
Background image of page 1

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

View Full DocumentRight Arrow Icon
Which of the following features indicates that a method is recursive? A. It includes at least one for statement B. It isolates the case when its parameter is equal to 1 and deals with it separately C. It decreases the value of its parameter within a loop D. It calls itself 23. From which class is the FallingCube class in Ramblecs derived? A. JApplet B. JPanel C. Object D. None 24. What is called “garbage collection”? A. Removing .class files after their source code has been removed or modified B. Removing objects that are no longer used in the program and releasing their memory C. Removing debugging information from .class files D. Removing all remaining events from the program’s queue when the program finishes 25. What should a name of a method sound like? A. Like a noun (e.g., someCalculation ) B. Like an adjective (e.g., active , slow ) C. Like a verb or past participle (e.g., calculateSomething , isFound ) D. All of the above are in good style. 26. Which of the following errors is likely NOT to be caught by the compiler? A.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/24/2012 for the course HUM 9999 taught by Professor Variousprofessorslisted during the Summer '06 term at Abilene Christian University.

Page1 / 11

MC Exam1st Semester - APCSFinalExam,1stsemester True-False...

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

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