About Question com.enthuware.ets.scjp.v6.2.610 :

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
ETS User

About Question com.enthuware.ets.scjp.v6.2.610 :

Post by ETS User »

There is declaration:
Object prevObj

And next in method u use:
prevObject

It won't compile. Please change variable name correctly.

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

Re: About Question com.enthuware.ets.scjp.v6.2.610 :

Post by admin »

This has now been fixed.

Thank you for your feedback!
If you like our products and services, please help us by posting your review here.

Pierluigi
Posts: 8
Joined: Thu Feb 23, 2012 5:33 am
Contact:

Re: About Question com.enthuware.ets.scjp.v6.2.610 :

Post by Pierluigi »

Hello,
I think that the explanation to the answer #5 is not exact. The explanation states: "0 is an int (a primitive) and you cannot pass it to a method that needs an object!!!".
If the argument object is a wrapper type, then any primitive value that can be autoboxed to that wrapper type can be successfully passed as an argument.
If the object is an Object, then any primitive number (be it an int, float, double, etc..) will be implicitly autoboxed by the compiler to its corresponding wrapper type (Integer, Float, Double, etc..) and then implicitly cast to Object to match the argument type of the method.

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

Re: About Question com.enthuware.ets.scjp.v6.2.610 :

Post by admin »

You are right. The explanation should mention this point. In this case though, the method parameter is List, and so auto-boxing will not occur.
This will be fixed asap.
thank you for your feedback!
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests