Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compile and run time errors

 
sonir shah
Ranch Hand
Posts: 435
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
S Khan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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=http://java.ditmas.net]Ditmas' Java
 
Junilu Lacar
Bartender
Pie
Posts: 7760
62
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic