Apologies for the screenshot, figured out how to copy/paste from the command prompt now
Can someone explain packages to me? I ran a sample of code from my book, a simple program called "BeerSong". In the source code it includes "package chap01;" before the class begins (this is also the name of the folder that the file is located in, if that makes a difference). However, when I go to run the code I get the following error:
C:\Users\reega_000>cd\
C:\>cd \Users\reega_000\Desktop\Coding\Head-First-Java-master\chap01
C:\Users\reega_000\Desktop\Coding\Head-First-Java-master\chap01>javac BeerSong.java
C:\Users\reega_000\Desktop\Coding\Head-First-Java-master\chap01>java -classpath . BeerSong
Error: Could not find or load main class BeerSong
I can get the program to run fine if I go into the source file and remove the package statement at the beginning. What is the cause of this?