• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot find symbol

 
Juhan Voolaid
Ranch Hand
Posts: 179
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 47222
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 179
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahh ... big thanx. I thought I was going crazy.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic