Exercises and Self Test Questions
Exercise 1 - 3 Using the API Documentation
- Find the println method description in the System class
Exercise 1 - 4 Create another simple Java application
- Create an application that prints the following 3 strings on separate lines: “Why am I doing this” , “I must be mad”, “Java is .....”
- Compile and run the program
The Menu Applet
- Create an applet called MyMenu that displays the following text in the applet:
- Print first string
- Print second string
- And now print the third string
- Print first string
- Now create a simple html file that will display the applet. Make the applet size 300 by 400
- Use Appletviewer to display the applet
- Now use your desired internet browser to display the
applet
Self Test Question
- Is Java compiled or interpreted? Why?
- If you create an application on an Apple Macintosh machine, can you run the same program on a Sun Solaris platform? Why?
- What does the term “Garbage Collection” mean?
- What does the class loader do? What about the bytecode verifier?
- What is wrong with this code snippet?
Public class BadClass{
Public void main(string args){
…
…
}
} - What language does Java resemble most closely?
No comments:
Post a Comment