Your browser has JavaScript turned off. This page is best viewed with Javascript enabled. Certain functions on this site will not work, and some style sheets will not load. Check your browser preferences to enable JavaScript.

Teach Yourself Java

Lesson 1 Quiz

1. What is Java (in regard to Computer Science)?
A type of coffee
An object-oriented programming language
An interactive website
None of the above

2. What is an Applet?
A type of computer
A Java program that is run through a web browser
An interactive website
A type of fruit

3. Java runs on _______.
Windows
Unix/Linux
Macs
All of the Above

4. Put the following in the proper hierarchy in terms of which calls on which.
Class, function
Function, class

5. Why can't the whole program just consist of the one line that does the painting?
In Java, to create an applet, you can't call on functions without defining a class to call them.
To appear on the web, Java must use an applet, and without first defining a class, you won't be painting onto anything.
The drawString function is not defined without the "import" statements at the top.
All of the above.

6. What's the difference between an Applet and an application?
An application is only available on Windows
Applets can paint words, applications cannot.
Applets are run over the web.
None of the above.