It sounds like your classpath is not set up correctly. Moving to Java In General (Beginner) where classpath issues are covered. If you're in a hurry for the answer, check out the Java in General FAQ entries on setting up the classpath.
When B.java compiles, it needs to be able to find A.class.
As Ben suggested, this sounds like a classpath issue. My guess is that you have set a system classpath that does not contain a dot (.) for the current directory. Try compiling with the classpath flag...
C:\>javac -cp . B.java
Note the spaces around the dot. If this works, then you need to either remove your system classpath or at least make sure it contains a dot.
Joined: Jan 22, 2008
thnx a lot..i got it.i didnt set the classpath thats why getting error