There seems to be an easier explanation. If you observe closely, all but one of the options will result in an ArrayIndexOutOfBoundsException. All of the options involve matrices with a first dimension expression of 4 or 5, yet only one of the options have a 'for' loop termination condition of i < 5. The others therefore end up trying to access the 5th index of an array with only 4 or 5 elements.
In light of the enthuware explanation, I think this wasn't what the question was trying to test. Maybe change the available answer options or recategorise the question?
About Question enthuware.ocajp.i.v8.2.2015 :
Moderator: admin
-
- Posts: 5
- Joined: Mon Jan 17, 2022 12:32 pm
- Contact:
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v8.2.2015 :
Yes, process of elimination is a good way to spot the wrong options. It is a useful strategy when you are not sure about the right approach to solve the given problem. The purpose of the explanation is to show you the right approach.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 40 guests