This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Package error Help ??????? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Package error Help ???????" Watch "Package error Help ???????" New topic
Author

Package error Help ???????

Dorj Galaa
Ranch Hand

Joined: May 29, 2001
Posts: 113
I'm wrote this code create package
package use;
public class MyClass1
{
public int A=0;
public MyClass1()
{
A=0;
}
public MyClass1(int b)
{
A=b;
}
public void setInts(int b)
{
A=b;
}
public int getInts()
{
return A;
}
}
this code is calling getInts method
import use.*;
import java.lang.*;
public class aaaa
{
public static void main(String args[])
{
MyClass1 a=new MyClass1(100);
int ss=a.getInts();
System.out.println(Integer.toString(ss));
}
}
but clause cannot access MyClass1 error;
how to create and use package


Senior software engineer
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Dorj,
I had no problem using your stuff under JDK1.2 using WinNT. Here's what I did:
1. Created directory c:\temp\use
2. Compiled MyClass1.java into MyClass1.class and placed it into the new directory.
3. Compiled aaaa.java into aaaa.class and placed it into c:\temp directory.
4. Ran the aaaa.class program from within the c:\temp directory.
Regards,
Manfred.
Dorj Galaa
Ranch Hand

Joined: May 29, 2001
Posts: 113
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Package error Help ???????
 
Similar Threads
How to configure the Cofiguration file in spring if we want to decide at run time which child object
interesting code
centering g.drawString
Turn Based Strategy Games
Scope of variable declarartions in for loop