Following example demonstrates how to set destination of the class file that will be created after compiling a java file using -d option with javac command.
c:> javac demo.java -d c:\myclasses
Result:
The above code sample will produce the following result.