if(firstValue == secondValue){ int total = firstValue + secondVaue; System.out.println("The values are equal");}System.out.println("The total is " + total);Why will the above println() statement cause an error?
What will be an ideal response?
When blocking statements, it is crucial to remember that any variable declared within the block is local to that block. In the above code, a variable named total is local to the block following the if. The ending println statement causes an error because the total variable is not recognized.
You might also like to view...
Which of the following is FALSE about an index in Word 2010?
A) You can select Mark or Mark All to include occurrences in an index. B) The Insert Index button is on the References tab. C) You first create the index from the Insert Index button, then mark the index entries. D) An index provides an alphabetical listing of topics in the document.
Norton Antivirus can perform which of the following scans?
a. Instant messages b. Email attachments c. File scanning d. All the above