aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes confused 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 "confused" Watch "confused" New topic
Author

confused

pankaj goswami
Greenhorn

Joined: Oct 10, 2007
Posts: 16
hi to all members out there. i am always confused in concept of compile error and exception. In coding i know where is wrong this code but i can not tell that it will lead to compile error or throw exception.


so please clear my this concept. Difference between compile error and exception in nutshell?
Doug Slattery
Ranch Hand

Joined: Sep 15, 2007
Posts: 294
Hi Pankaj,

Originally posted by pankaj goswami:
hi to all members out there. i am always confused in concept of compile error and exception. In coding i know where is wrong this code but i can not tell that it will lead to compile error or throw exception.

so please clear my this concept. Difference between compile error and exception in nutshell?


In a nutshell, the difference is fairly simple. A compiler error is generated if there is an error in syntax or semantics of your code (i.e. a keyword is misspelled, a missing semicolon, a missing closing parentheses or bracket).

There are two types of exceptions: checked - which is generated by the compiler, and unchecked - which isn't detected by the compiler, but thrown at runtime.

An example of a checked exception would be an Exception that is caught multiple times in a try/catch block:


An unchecked exception is generally encountered due to some uncontrollable system problem such as a network drive being down when trying to open a file on that particular drive. In this case, there is (obviously) no way for the compiler to know the network drive is unavailable.

Hope this helps...
Aloha,
Doug

-- Nothing is impossible if I'mPossible
pankaj goswami
Greenhorn

Joined: Oct 10, 2007
Posts: 16
thanks for your reply.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: confused