File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Studying from Head First Java (2nd Ed.) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Studying from Head First Java (2nd Ed.)" Watch "Studying from Head First Java (2nd Ed.)" New topic

Studying from Head First Java (2nd Ed.)

Bryce Monaco

Joined: May 06, 2013
Posts: 1
So I have literally just started reading the book, and I am stuck at the first lesson. The lesson has you create a small applet (if that's the right term) that acts as a party invitation. The problem that I am having is that the compiler is returning 'Symbol Not Found Error' on things such as capital letters, and even periods.

My code (copied directly from the book, line for line)

And the compiling error

If someone could explain what is happening (with some detail, I'm a beginner remember ;) ) and what I could do to fix it, I would greatly appreciate it.
Rameshwar Soni
Ranch Hand

Joined: Feb 03, 2011
Posts: 247
Bryce, Welcome to Ranch

You have imported the packages incorrectly. It should have been

As you can see the * which means you are importing all the classes from the awt and event package.

If you need to import only a single class from a package then it would be written like this

Here only the Frame class would be imported from awt package
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46320
Welcome to the Ranch

Beware of the Party example from HFJ; it is incomplete and cannot be executed in its current form. It is usually considered better form to list all the classes you are importing, even if you have several lines starting
I agree. Here's the link:
subject: Studying from Head First Java (2nd Ed.)
It's not a secret anymore!