File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes referring other classes ... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "referring other classes ..." Watch "referring other classes ..." New topic
Author

referring other classes ...

Bala Krishniah
Ranch Hand

Joined: Dec 14, 2000
Posts: 81
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

Joined: Dec 14, 2000
Posts: 81
Sorry, I guess this is the wrong place to post the above
question...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: referring other classes ...