About Question enthuware.ocajp.i.v8.2.862 :

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
Javier
Posts: 66
Joined: Mon Feb 20, 2017 12:31 pm
Contact:

About Question enthuware.ocajp.i.v8.2.862 :

Post by Javier »

Hello Paul!
I would like to ask a question, perhaps it is a little bit silly because my understanding in English is not really great.
with the statement,
d=d +1;
"This will not compile because Java does not allow operator overloading for user defined objects."
This means that we can not use operator overloading for created objects?
Thank you very much Paul

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

Re: About Question enthuware.ocajp.i.v8.2.862 :

Post by admin »

Actually, you are right. The statement is not proper. It should say, "This will not compile because Java does not allow operator overloading for user defined classes."

Java overloads the + operator only for String class. It does not allow this operator to be used with any other class unless one of the operands is a String.

hope this helps and thank you for your feedback!
Paul.
If you like our products and services, please help us by posting your review here.

Javier
Posts: 66
Joined: Mon Feb 20, 2017 12:31 pm
Contact:

Re: About Question enthuware.ocajp.i.v8.2.862 :

Post by Javier »

Thank you very much Paul!
I understand it much more clear now!

Post Reply

Who is online

Users browsing this forum: No registered users and 30 guests