Philip OpenSource Technology Lab
The purpose of this page is very simple. To share real, actionable learning materials on technology, Welcome aboard!
Short and simple explanation of what a bug is in terms of computer programs.
A bug is an error in code that gets the computer lost. That is, when the computer encounters the bug, it won't know what else to do.
So basically, the computer gets stuck and can't find a way out of there.
To solve this, we use something called "Exception Handling"
This is a line of code that we include before the code that is suspected to have the bug.
The two keywords in exception handling are, "try" and "catch"
Try detects something unusual about the code and instead of the program crashing, it throws an exception.
This exception is another piece of code inside the catch block that is excecuted when a program fails as a result of a bug.
Exception Handling is used to solve the problem of the computer getting lost when it encounters a bug.
Do you understand?
Click here to claim your Sponsored Listing.