1.

Can You Explain The Cs Option Of Java Interpreter?

Answer»

When you develop Java using Sun's JDK, you normally compile your source by using the javac compiler. If no compile errors exist, you then run your application using the java interpreter. As a shortcut, you can specify the -cs COMMAND-line switch when you invoke the java interpreter. The java command, in TURN, will AUTOMATICALLY compile out-of-date (modified) source-code files for you.
By using the -cs switch, you can make changes to your source and IMMEDIATELY execute the java interpreter without having to manually run the java compiler yourself. The java interpreter knows which files it needs to recompile by comparing each file's MODIFICATION dates against the corresponding class modification date. Normally, programmers use the -cs option when they have made a minor change to the source files and know that the files contain no compilation errors. The following command illustrates the use of the -cs switch:

C: JAVACODE> Java -cs MyProgram <Enter>

When you develop Java using Sun's JDK, you normally compile your source by using the javac compiler. If no compile errors exist, you then run your application using the java interpreter. As a shortcut, you can specify the -cs command-line switch when you invoke the java interpreter. The java command, in turn, will automatically compile out-of-date (modified) source-code files for you.
By using the -cs switch, you can make changes to your source and immediately execute the java interpreter without having to manually run the java compiler yourself. The java interpreter knows which files it needs to recompile by comparing each file's modification dates against the corresponding class modification date. Normally, programmers use the -cs option when they have made a minor change to the source files and know that the files contain no compilation errors. The following command illustrates the use of the -cs switch:



Discussion

No Comment Found