Which statement is FALSE about the try{} block?

  1. Some of the statements in a try{} block will never throw an exception.

  2. The statements in a try{} block may throw several types of exception.

  3. The try{} block can not contain loops or branches.

  4. The try{} block must appear before the catch{} blocks.


Correct Option: C
Explanation:

To answer this question, the user needs to know about the try-catch-finally block in exception handling.

Option A is true because not all statements in a try{} block will throw an exception, some statements may never throw an exception.

Option B is true because the statements in a try{} block may throw several types of exception.

Option C is false because the try{} block can contain loops and branches.

Option D is false because the try{} block can appear anywhere in the try-catch-finally block, as long as it appears before the catch{} and finally{} blocks.

Therefore, the answer is:

The Answer is: C. The try{} block can not contain loops or branches.

Find more quizzes: