File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Compile and run time errors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Compile and run time errors" Watch "Compile and run time errors" New topic

Compile and run time errors

sonir shah
Ranch Hand

Joined: Nov 01, 2001
Posts: 435
hi ..
I am appearing for SCJP next month.Frankly speaking my concepts are very weak.
Can any one explain the difference between compile and run time errors.How do we come to know which one is a compile time error and which one is run time.
In many examples we see the output as compile error on line 6. compile error on line 13..etc..How can one understand this concept.
Kindly help..
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
The compiler can detect a variety of structural errors in your program but it can't detect certain problems. You need to do a LOT more writing and compiling of your own programs to get a firm grasp - just reading is not enough.
author of:
S Khan

Joined: Sep 11, 2001
Posts: 13
I agree, you cannot become efficient in something like a programming language just by reading and studying, you have to code your own way out.
- Salman Khan of Ditmas Technologies[/ur/]

[URL=]Ditmas' Java

-Salman Khan of <A HREF="" TARGET=_blank rel="nofollow">Ditmas Technologies</A><P><A HREF="" TARGET=_blank rel="nofollow">Ditmas' Java</A>
Junilu Lacar

Joined: Feb 26, 2001
Posts: 6529

I agree with Bill, practice writing and compiling code. That's the only way you will get a really good grasp of what is a compile time and runtime error.
My rule of thumb though:
Most errors that have to do with assigning values of one type to another incompatible type can be caught by the compiler. Errors involving improper use of keywords and other syntax errors will be caught at compile time as well.
Memorize the figure in RHE that shows the direction that automatic conversions can go. This will go far in helping you determine whether an error will be caught at compile time.

Junilu - [How to Ask Questions] [How to Answer Questions]
I agree. Here's the link:
subject: Compile and run time errors
It's not a secret anymore!