File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Compilation and runtime..... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Compilation and runtime....." Watch "Compilation and runtime....." New topic
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: 3837

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: 39393
    
  28
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Compilation and runtime.....