Objectives
- Use some basic DOS (command prompt/console) commands
- Discuss some naming conventions
- Describe some Java naming rules
Note: Windows and the command prompt are NOT case sensitive, but Java is. You can type a command like "dir" in upper or lower case. You can even type the name of Java commands in upper or lower case. Just make sure that any arguments that you send to the Java commands are in the correct case.
Command | What it does |
---|---|
dir | lists contents of current working directory |
cls | clears the screen |
h: | changes current working directory to drive H |
cd dir1 | changes the current working directory to a child directory named "dir1" - if it exists |
cd .. | changes the current working directory to the parent of the current working directory |
cd \ | changes the current working directory to the root directory of the current working drive |
mkdir dir1 | create a child directory named "dir1" in the current working directory |
rmdir dir1 | deletes a child directory named "dir1" - if it exists |
erase file1 | erases a file named "file1" in the current working directory - if it exists |
rename file1 file2 | renames "file1" to "file2" - if file1 exists and file2 does not exist |
copy file1 file2 | makes a copy of "file1" and names it "file2" - if file1 exists and file2 does not exist |
help | displays a list of all the DOS/command prompt commands that are available |
help command | displays detailed usage information on the specified command |
javac MyProgram.java | compiles MyProgram.java into MyProgram.class - this is part of Java, not DOS |
java MyProgram | runs MyProgram.class using the JVM - this is part of Java, not DOS |