Publish On: 2019-05-17

Guy white

Total Post: 819

Question: What is javac

Reply On: 2013-10-19

Computer Science

Total Post: 1

ANS: What is javac

Javac is the Java Compiler utility that you need to run in order to compile *. Java files. Note that when you type javac Apple.java, javac assumes that the Apple.java file is in the current directory.

Assuming everything is correct, the file will compile. A Java source code file with a.javs extension gets compiled into a file with a.class extension.

Accordingly, you should see a Apple. Class file created in the directory where you have placed the Apple.java file. The Apple. Class file contains bytecode instructions.

Note that the compilation will fail if you save the file with a name different than the class name. for example, if you save the above file as Orgage.java, you will see the error “C:sSymbiosisSourceCodeOrange.java:1: class Apple is public, should be declared in a file named Apple.java “.


Submit Your Answer

warning: Please Login To Submit Your Answer
Like Us On Facebook for All Latest Updates