answersLogoWhite

0

One of them is creating *.class from *.java

Second is identifying syntax errors in the *.java files and intimating the programmer so that he can correct them

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

SteveSteve
Knowledge is a journey, you know? We'll get there.
Chat with Steve
ReneRene
Change my mind. I dare you.
Chat with Rene
LaoLao
The path is yours to walk; I am only here to hold up a mirror.
Chat with Lao
More answers

Check the program, written in source code, for errors. If there are none, convert it to a compiled program. In the case of Java, this compiled program is called "bytecode", and is supposed to be run in a JVM (Java Virtual Machine).

User Avatar

Wiki User

12y ago
User Avatar

Add your answer:

Earn +20 pts
Q: What are two main purposes of the Java compiler javac?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the main feature of the programming language Java Classpath?

Java Classpath is a parameter that tells the Java Virtual Machine or the Java Compiler, where to search for user-defined classes and packages on a computer.


Why path and class-path in java?

1))What is the difference between "path" and "classpath"? Ans:: We keep all "executable files"(like .exe files) and "batch files"(like .bat) in path variable. And we keep all jar files and class files in classpath variables. So path is set according to the .exe files & .bat files And classpath is set according to the .jar files & .class files. Operating system tries to find .exe and .bat files in path and JVM tries to find all classes in classpath.


Examples of codes in java?

public class Hello{//opens the classpublic static void main(String args[]){//opens the main methodSystem.out.println("Hello World");}//closes the main method}//closes the classNote: The compiler all the sentences that have "//" before them.


How to write java program without using main method?

Java program without mainWe need a main method for executing a program.But YES we can write a program without using main() method.TRICK 1 of 2 :: while writing applets in java we don't use main... we use init() method instead.TRICK 2 of 2 :: using 'static' we can write a program whic will execute successfully and output the desired message on screen. Here it is :: class Mohit{ static { System.out.println("This java program has run without the main method"); System.exit(0); } } -->save the program as Mohit.java to compile::javac Mohit.java (in command prompt) to run ::java Mohit(command prompt) output will be ::This java program has run without the main methodWhoa!!!!! we are done.;)


Give sample program?

class firstprog { public static void main (String args[]) { System.out.pritnln("My first Program in Java "); } } Simple Java Programe Write the above program in Ms dos's edit or Notepad of Windows save it with "firstprog.java" run the commands given below in command prompt of Ms Dos to get the output Remamber Java is case sensative so mentain capital and small letter. 1. javac firstprog.java 2. java firstprog