Hmm. My compiler was telling me the package didn't exist, so when I removed the package declaration it ran fine. Are the files saved in the same directory?
Ok so I feel dumb, I figured out what the issue is. The compiler is looking for a directory called "MyPack" and not finding one. Create a folder called MyPack and add the Balance.java and Balance.class files inside of it. This should fix your issue. Now you just have to import the package in the AccountBalance.java file.
From command prompt also I am getting this
Exception in thread "main" java.lang.NoClassDefFoundError: MyPack/AccountBala
Caused by: java.lang.ClassNotFoundException: MyPack.AccountBalance
at java.net.URLClassLoader$1.run(URLClassLoader.java:220)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:208)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
Error: Could not find the main class.
Error: A JNI error has occurred, please check your installation and try again.
I am making sure I am outside Mypack package while running the program and I am using java MyPackage.AccountBalance to run but still no success