• Post Reply Bookmark Topic Watch Topic
  • New Topic

Types of Errors  RSS feed

 
Ekwem Sampson
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please I willlike to know more about the errors in Java: Runtime, compilation, fatal, non-fatal and logic errors. thanks
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Welcome Ekwem to Javaranch

Here in Java , we call errors as exceptions. chk out the Tutorial
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Exceptions" are a specific kind of error signal that occurs while a program is running.

Compilation errors are error messages reported by the compiler, long before your program runs.

"Logic errors" are mistakes you make in your thinking as you write a program. They may never be reported.

"Fatal" errors would be those that make a program or process terminate ; a non-fatal error would be an error that's ... not fatal.




 
kshitij dogra
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ekwem

I literally have to make it short, for the obvious reasons.

As Balu said errors in java are termed as exceptions. Also the main class is Throwable , whiich can furthur be divided in to

- Exceptions
- Errors

Exceptions can further be checked(checked by the compiler to see whether they are appropriately caught or not) and unchecked .

Errors on the other hand, can be caught by the Runtime environment (or rather should be)

For details you can refer to

- Complete Reference

- K&B
 
Campbell Ritchie
Marshal
Posts: 56529
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for the delay; while I was having dinner everybody else was writing.

Welcome to JavaRanch ( ) and what an interesting first question.

The least serious type of error is the compiler error, because you have spelt something wrong, not paired off () [] {} <> correctly, used a variable “out of scope,” etc. etc. There are hundreds of potential causes for compiler errors. These are the best sort, because you find out about them soon and can correct them before they turn into more serious errors. In fact there were complaints that Java used not to support generics; that is a way of converting a runtime error to a compiler error. There are websites about compiler errors e.g. MindProd and many others.

More serious are runtime errors, which people have already told you about. As people said, most runtime errors show themselves by an Exception. Have a look at the Java™ Tutorials link in the first reply, and bookmark the Tutorials: that’s a good resource.

The most serious of all, because the application can continue to run, are logic errors. They can cause the application to run and produce a wrong result, which is why they are so dangerous.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!