Best Answer

Compile time error is any type of error that prevent a java program compile like a syntax error, a class not found, a bad file name for the defined class, a possible loss of precision when you are mixing different java data types and so on.

A runtime error means an error which happens, while the program is running. To deal with this kind of errors java define Exceptions. Exceptions are objects represents an abnormal condition in the flow of the program. It can be either checked or unchecked.

User Avatar

Wiki User

โˆ™ 2010-04-29 21:11:35
This answer is:
User Avatar
Study guides


1 card


See all cards
23 Reviews

Add your answer:

Earn +20 pts
Q: Difference between run time error and compile time error in java?
Write your answer...
Still have questions?
magnify glass
Related questions

How compile time error arises in java?

'Compile time error' is when the compiler (javac) detects an error in your program.

What is the difference between run time and compile time in java?

Very simply, Java compile time is when Java is in the process of compiling source code, and run time is when Java is actually executing your program.

What is the difference between javac and java commands?

javac compiler can be used for compile the program and java can be used for run the program.

It is not an error not to end a Java file name with the java extension?

If you want to compile a java program the name of that source code must end with extension .java

What is the difference between exception and error in java?

Error: Any departure from the expected behavior of the system or program, which stops the working of the system is an error. Exception:Any error or problem which one can handle and continue to work normally. Note that in Java a compile time error is normally called an "error," while a runtime error is called an "exception." Errors don't have subclasses while exception has two subclasses, they are compile time exception or checked exception (ClassNotFound Exception, IOException, SQLException etc.) and runtime or unchecked exception(ArrayIndexOutOfBounds Exception, NumberFormat Exception).

How do you compile java programming language?

use the javac keyword to compile a Java program.javac is the syntax to compile a java file.

Difference between run time error and run time exception in java?

Runtime Error Cannot be Rectified but Runtime Exception can.

What is the Command to compile and execute a java program?

javac ^that will compile java ^that will execute

What is difference between java 2 and java?

there is no difference between java2 and java. its same.

What do you get when you compile a java program?

When you compile a Java source file (.java) you get a Java bytecode file (.class). The bytecode in these .class files can be executed by the Java Virtual Machine.

How do you make software from a simple java program?

You compile it.You compile it.You compile it.You compile it.

Can an abstract method be declared static in java?

No, Java will fail to compile: "illegal combination of modifiers: abstract and static"This is a rather odd error, since Java does allow you to override static methods.

People also asked