There's no functionality that I know of. You will have to create a java file of choice and cut-paste the class in the new file. Fix the imports and package declaration names (if need be).
EDIT The best way to do it: Simply create a blank file B.java, go back to A.java, highlight B.java and right click and select Refactor -> Move (Alt+Shift+V for short). It will move the class B to B.java.
I have tested and it works. You might need to manage imports if necessary.