About Question enthuware.ocajp.i.v7.2.925 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
Almand

About Question enthuware.ocajp.i.v7.2.925 :

Post by Almand »

Hello!
It seems there's an error in the Enthware JA+ V7 test - it's in the Q18 of LastDayExam:

Given:

import java.util.*;
public class TestClass {
public static void main(String[] args) throws Exception {
ArrayList<Double> al = new ArrayList<>();

//INSERT CODE HERE
}
}
What can be inserted in the above code?

you have to select 3 options:
1. al.add(111);
2. System.out.println(al.indexOf(1.0));
3. System.out.println(al.contains("string"));
4. Double d = al.get(al.length);
5. al.notifyAll();

The corrent answers (by your version) are 2, 3 and 5.
But it seems to me 5 is not suited here.
The program will compile with line at 5 inserted, but it will throw IllegalMonitorStateException, because notyfyAll() method should be called within a synchronized context.
In order to be the 5 option correct the answer should be something like:
What can be inserted in the above code, so it will compile without a problem?
Currently, the question is too vague to give a certain answer.

Online
admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.925 :

Post by admin »

You are right. The question should make it clear that it is only talking about compilation. This has now been fixed.

Thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests