Package name is different than the folder structure but still Java code compiles
I am using Notepad++ to write my Java code and Command Prompt to compile and run it. Following is my sample Java code, package abraKadabra; public class SuperClass{ protected int anInstance; public static void main(String [] abc){ System.out.println("Hello"); } } However, this file is in the following folder structure : "usingprotected\superPkg" (usingProtected is a folder somewhere in the hierarchy in C:) So, my package name here should be something like usingProtected.superPkg instead of abraKadabra as I wrote it. But, when I compile this Java code from command prompt, it compiles fine with