Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

referring other classes ...

 
Bala Krishniah
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to create and small test application in Tomcat. I have 2 public classes, both in the same package. Class 1 reffers to class 2.
My directory stucture is as follows...
WEB-INF
|_classes
|_com
|_Catalog
|_ch05
class 1: Catalog.java
----------------------
package com.catalog.ch05;
public class Catalog
{
//referrs to class 2
private Item it = new Item();
}
class 2: Item.java
-------------------
package com.catalog.ch05;
public class Item{...}
But when I compile class 1 (Catalog.java), it is throwing error. saying, the class 2 is not recognized. The error is...

catalog.java:37: cannot resolve symbol
symbol : class Item
location: class com.catalog.ch05.catalog
items.addElement(new Item());
^
What is the problem?...I appriciate the help.
Thanks!
 
Bala Krishniah
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I guess this is the wrong place to post the above
question...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic