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.. Thanx..
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. Bill ------------------ author of:
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/]
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