Java Reference
In-Depth Information
5. Click the PrintStream link. When the Class PrintStream page is displayed,
scroll to the Method Summary table. Choose any five methods and then
click the links and read their descriptions. Make a list of the five methods,
their return values, and their argument data types.
6. Write a paragraph explaining why you think some of the methods are listed
more than once in the Method Summary table.
Short Answer
1. The keyword public is an example of a(n) _______________.
2. In Java, every line of code, other than headers and braces, must end with
a ( n ) _______________.
3. Line comments begin with _______________; b l o c k c o m m e nts begin with
_______________ and end with _______________.
4 . _______________ is/are collections of classes, sometimes called libraries, which
contain portable Java bytecode files.
5. A misspelled method most likely would result in a(n) _______________ e r r o r.
6 . T h e _______________ c o mmand is placed at the beginning of Java source code
to load the appropriate class package.
7. When you extend the Applet class, you are creating a(n) _______________ o f
the Applet class.
8 . T h e _______________ i s a c u r r e n t d a t e and time generated by the operating
system of a computer.
9. The println() method takes a String _______________ i n p a r e ntheses.
10. The keyword void means the method returns _______________.
11. Java looks for the _______________ a s the usual starting point for all stand-
alone applications.
1 2 . A ( n ) _______________, w h i c h i s easily identified by the = new notation, both
declares the type of data or object to be stored and assigns it a variable name
in the computer's memory.
13. Describe the difference between the println() and drawString() methods.
14. Describe the code differences between applications and applets.
15. Describe the execution differences between applications and applets.
16. Explain why a Date object cannot be used with the drawString() method.
17. List the three-step process to save, compile, and execute a program.
18. Explain why an HTML host document is needed along with an applet.
19. Write a line of code to declare and construct a Date object named curDate.
20. Write a line of code to assign an image from the current folder to the vari-
able name grandma.
21. Write a line of code that will change an applet's background color to red.
22. Write a line of code to print each of the following in the command prompt
window:
a. your name
b. a previously declared String named lastName
(continued)
Search WWH ::




Custom Search