| Author |
Compilation and runtime.....
|
mansi gupte
Ranch Hand
Joined: Dec 30, 2008
Posts: 72
|
|
Hi all,
In some of the questions of the mock exams, i came across options where they ask if its a compilation error or runtime one.My doubt was that, is there a proper way through which we can find out the difference between compile and runtime errors?
Let me re-phrase the question , What all things happen during the compile time and the runtime?
Thnks,
Piyu
|
 |
Vijitha Kumara
Bartender
Joined: Mar 24, 2008
Posts: 3670
|
|
piya rai wrote:
In some of the questions of the mock exams, i came across options where they ask if its a compilation error or runtime one.My doubt was that, is there a proper way through which we can find out the difference between compile and runtime errors?
Compilation errors are mainly due to syntax errors made by the programmer (Compiler make sure the program is syntactically correct to be run by the JVM). But the runtime errors are due to actual runtime information (actual type of an object, the data passed to methods are incompatible etc...) which are unable to determine at the compile time.
|
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32708
|
|
|
Those causes of runtime errors are rare. Runtime errors are usually expressed by Exceptions. Go and find the Exception class and its subclasses; each subclass represents a type of runtime error which Java knows about already.
|
 |
 |
|
|
subject: Compilation and runtime.....
|
|
|