Piet Souris wrote:I think that it has to do with boxing: an Integer can be boxed to a double, but not to a Double. And my terminology may be wrong...
Mike Simmons wrote:
Jay Chung wrote:in this case, I would've thought that line * follows rule B, but if that were the case, then it would be
Predicate p = Predicate(), which then should cause * to NOT COMPILE as it does not implement
public boolean test(Object o)
Your interpretation is pretty good, but a little off. In rule B, it's not that the compiler treats new ObjectInstance<Type>() as new ObjectInstance() for the entire statement. Rather, it makes that substitution, ignoring the generic parameter, while evaluating the assignment part (the =). So think of the compiler as looking at the expression in different parts. First:
This part makes sense on its own - a CourseFilter needs to have a boolean test(String). Great! The compiler is happy with this.
And then this part:
When the compiler looks at the assignment, it basically asks itself, can the thing on the right be treated as the thing on the left? Which in this case means, can a Predicate<String> be treated as a Predicate? The answer is yes, it's willing to ignore the generic part and let the assignment take place. If you want to treat this as a raw Predicate, you can, the compiler will let you. However that doesn't mean it's re-evaluating the entire right hand side to make it conform to the raw Predicate type. The right hand is still a Predicate<String>, with a test(String) method. And the assignment is allowed to happen.
Now at run time, you may still run into problems. What happens if you run the following?
Paul Anilprem wrote:
Although not too scientific, you may want to check out this 1z0-809 average score comparison page, which shows that people usually score higher on the real exam.
So, from that perspective, your score isn't actually bad. The more worrisome fact is that your score decreased in the last three tests. You need to analyze your results and see what kind of mistakes are you making. Are you making the same mistakes again and again or the test hit upon new topic/tricks that you had not read about?