I 开发者_C百科got one problem while accessing classes in main class within a same package.... it shows error like "bad class name\name.class ......
public class Showall
{
void print()
{
System.out.println("We Will show all the details");
}
public static void main(String args[])
{
Showall sa=new Showall();
sa.print();
Name n=new Name();
n.showname();
}
}
............................. here Name is class which is placed in same package. ..................................
class Name
{
void showname()
{
System.out.println("Satwinder");
}
}
Class names can only contains IDs (basically a-z, A-Z, 0-9 and _) and .
Edit your question to show the code how you try to access the class.
精彩评论