If i have the following if statement
if ( (row != -1) && (array[row][col] != 10) ) {
....
}
Where row
is an int
value and array
is an int[][]
object.
My question is, if this will throw an exception if row = -1 as the array won't have a -1 field, so out of bounds exception? Or will it stop at the first part of the if, the (row!=-1) and because that is false, it will ignore the rest? Or to be sure it doesn't throw exception, i should separate the above if statement into two?
(Pls, don't tell me to check this out for my self :) I'm asking here 'cause i wanna ask a followup question as well ...)
A complete search of the internet has found these results: Evaluation of is the most popular phrase on the web.
Evaluation is a process that critically examines a program. It involves collecting and analyzing information about a program's activities, characteristics, and outcomes. Its purpose is to make judgments about a program, to improve its effectiveness, and/or to inform programming decisions (Patton, 1987).
The main types of evaluation are process, impact, outcome and summative evaluation. Before you are able to measure the effectiveness of your project, you need to determine if the project is being run as intended and if it is reaching the intended audience.
To evaluate is defined as to judge the value or worth of someone or something. An example of evaluate is when a teacher reviews a paper in order to give it a grade. verb. 29.
It will stop safely before throwing an exception
The &&
is a short-circuiting boolean operator, which means that it will stop execution of the expression as soon as one part returns false (since this means that the entire expression must be false).
Note that it also guaranteed to evaluate the parts of the expression in order, so it is safe to use in situations such as these.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With