This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Cannot find symbol Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Cannot find symbol" Watch "Cannot find symbol" New topic
Author

Cannot find symbol

Juhan Voolaid
Ranch Hand

Joined: Nov 18, 2003
Posts: 179
Hi

This is so basic problem, but I just can't solve it.

I have too classes:
1. main-class - Lab2.java
2. the other - Tree.java

Here are the source:

Lab2.java



and Tree.java



And the error I got after I compile my program with a line: javac Lab2.java
I get:

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38040
    
  22
You don't need a declaration for int p, and the line with = separately.
You can write int p = tree.getPrice();
I actually tried condensing your code, so your method comes out as:
and it compiles and runs nicely.

CR

I have also reverted to your original code, and it compiles without any reported errors.
[ October 16, 2005: Message edited by: Campbell Ritchie ]
Juhan Voolaid
Ranch Hand

Joined: Nov 18, 2003
Posts: 179
Ahh ... big thanx. I thought I was going crazy.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot find symbol
 
Similar Threads
compare() and compareTo()
how to deal with this error???
Making binary tree: memory problem
Java class query
Error can't find class