Hi
Im trying to compile the below program, but im not able to do it. Im getting the below error.
mycode is
[code]
import pack1.*;
import pack1.pack2.*;
class Result
{
public static void main(
String [] args)
{
class1.a = new class1();
class2.b = new class2();
a.getname();
b.putnum();
}
}
[\code]
when i try to compile this, i get the below error
C:\Program Files\Java\jdk1.5.0_09\bin>javac Result.java
Result.java:1: package pack1 does not exist
import pack1.*;
^
Result.java:2: package pack1.pack2 does not exist
import pack1.pack2.*;
^
Result.java:7: cannot access class1
bad class file: .\class1.class
class file contains wrong class: pack1.class1
Please remove or make sure it appears in the correct subdirectory of the classpa
th.
class1.a = new class1();
^
3 errors
Please help me understand why im receiving the error.