
<p>PreAPCS Exposure Java Exercises 07.01- 03 Date: Name: Period:</p><p>1. What are the 2 data fields of the Math class?</p><p>2. If you want to call a class method, what do you need to use?</p><p>3. If you want to call an object method, what must be created?</p><p>4. In the statement int num; int is the ______and num is the ______.</p><p>5. In the statement Bank tom; Bank is the ______and tom is the ______.</p><p>6. What phrase means the same thing as simple data types?</p><p>7. List 3 simple data types.</p><p>8. How many values can a simple data type store?</p><p>9. What 2 things can objects store?</p><p>10. ______provide information to methods for processing.</p><p>11. Methods fall into two major categories, what are they?</p><p>12. What kind of values do void methods return?</p><p>13. Which of the following is true? (a) A method can be BOTH a void method and a class method. (b) A method can be BOTH a void method and a object method. (c) A method can be BOTH a return method and a class method. (d) A method can be BOTH a return method and a object method. (e) All of the above</p><p>14. It is not possible to create large, reliable programs without being very conscious of ______. </p><p>Exposure Java 2013, PreAPCS Edition Exercises 07.01-03 Page 1 02-12-13 15. What is modular programming?</p><p>16. What are subroutines called in Java?</p><p>17. Can a program have other “secondary” methods besides the main or paint methods?</p><p>18. Explain the class-dot-method format for calling methods.</p><p>19. What is the class identifier?</p><p>20. What is the method identifier?</p><p>21. What is the difference between calling methods that you have created yourself and calling other methods?</p><p>22. Assume the existence of a Greetings class which contains a method called hello. Write necessary Java code to call the hello method.</p><p>23. List 3 things required by a user-defined method.</p><p>24. Compare programs Java0702.java and Java0703.java. Both programs have the same fullName, Street, and cityStateZip methods. The first program called the methods using the class-dot-method format. The second program calls the methods just by using the method name. How does this work if the name of the class is not specified?</p><p>25. Compare programs Java0703.java and Java0704.java. Both programs have identical main methods which call 3 other methods using only the method identifiers. The first program works. Why does the second program not compile?</p><p>26. Compare programs Java0704.java and Java0705.java. How does the second program cure the problem of the first?</p><p>Exposure Java 2013, PreAPCS Edition Exercises 07.01-03 Page 2 02-12-13 27. When is using the class identifier optional?</p><p>28. When is using the class identifier required?</p><p>29. If a program has more than one class, which class is the primary class?</p><p>30. If a program has more than one class, which class is declared public?</p><p>31. What Applet method controls the graphics display of an Applet in the same manner that the main method controls the sequence in an application program?</p><p>32. Look at program Java0706.java. Explain why this program is said to have “poor program design”.</p><p>33. In an application, is it considered poor design to put all of the program statements in the main method?</p><p>34. Are parameters necessary for all methods, or just the majorty of them?</p><p>35. What should the main method or the paint method look like in a well-desgined program?</p><p>36. Graphical output to an applet window requires the use of a ______object.</p><p>37. Any method that needs to display graphical output requires what?</p><p>38. If you choose to break up a large graphics program into multiple methods, you need to make sure that you ______to ALL of these methods.</p><p>39. According to Object Oriented Design, common methods should be placed in their own ______.</p><p>40. In a program with multiple classes, which is the driving class?</p><p>41. Compare the paint methods of Java0707.java and Java0708.java. In the second program, why are all of the method calls preceded with “House.”? </p><p>42. Refer to the previous question. Why was this not necessary in the first program?</p><p>Exposure Java 2013, PreAPCS Edition Exercises 07.01-03 Page 3 02-12-13 43. The key difference between creating parameter methods and non-parameter methods is the ______. </p><p>44. All method declarations have an identifier followed by ______.</p><p>45. What is the difference between an actual parameter and a formal parameter?</p><p>46. Information is passed from the ______to the ______.</p><p>47. An actual parameter can be several different things. List 5 examples.</p><p>48. Does parameter sequence matter?</p><p>49. Look at program Java0713.java. What is wrong with Line 1?</p><p>50. Look again at program Java0713.java. What is wrong with Line 2?</p><p>51. If a method has several parameters, do they all need to be of the same type?</p><p>52. Can the actual parameter identifiers be the same as the formal parameter identifiers?</p><p>53. Can the actual parameter identifiers be the different from the formal parameter identifiers?</p><p>54. List 4 important rules for using methods with parameters.</p><p>Exposure Java 2013, PreAPCS Edition Exercises 07.01-03 Page 4 02-12-13</p>
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages4 Page
-
File Size-