i am a complete newbie in java. while dealing with packages i faced the following problem.
I created a file named "CreatePackage"
Code:
package lobkush;
public class CreatePackage {
public CreatePackage() {
System.out.println("you are presently under package named \"lobkush\" ");
}
}
after this i created a folder named "lobkush".
I also compiled the source file and placed the .class file in the corresponding directory.
Now to test it i created another java file. This is where the problem arises.
while importing the class file if I write:
the compiler shows an error
but if I write
Code:
import lobkush.CreatePackage;
no error is shown and the .class file generated.
Can anyone please explain to me this unnatural behaviour????