Two public classes in the same package
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Vineet_Billorey
Posted On:   Thursday, February 9, 2006 01:10 AM

I have a package MyPackage . I create a file first.java in MyPackage and define a method test1() in it. It compiles well. Now I create another file second.java in the same MyPackage , and I write a method test2() in which I create an object of first class from the same package. Now I save second.java and compile second.java in the same directory. But it gives the following error: cannot resolve symbol symbol : class first location : class MyPackage.second { first f=new first(); Can any one please help me?    More>>

I have a package MyPackage .
I create a file first.java in MyPackage and define a method test1() in it. It compiles well.
Now I create another file second.java in the same MyPackage , and I write a method test2() in which I create an object of first class from the same package. Now I save second.java and compile second.java in the same directory. But it gives the following error:


cannot resolve symbol

symbol : class first

location : class MyPackage.second

{ first f=new first();



Can any one please help me?

   <<Less

Re: Two public classes in the same package

Posted By:   Jani_Kaarela  
Posted On:   Thursday, February 9, 2006 02:49 AM


Read The Java Tutorial, especially trails Getting Started and Learning the Java Language. If those don't answer your question, post the sources for your both classes and the exact steps you took to compile them here - but do your self a favour and read the tutorial stuff first!



Also, read the code conventions, your class/package naming scheme is horribly wrong. Code conventions do matter.

About | Sitemap | Contact