This will not compile because Java does not allow operator overloading for user defined classes.
Can you explain this with a example??
About Question enthuware.ocajp.i.v8.2.862 :
Moderator: admin
-
- Posts: 35
- Joined: Sat Nov 25, 2017 4:13 pm
- Contact:
-
- Site Admin
- Posts: 10045
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v8.2.862 :
Operator overloading allows you to define new behavior for existing operators such a +, - etc. You can do that in C/C++, but not in Java. You can see examples in c/c++ https://en.wikibooks.org/wiki/C%2B%2B_P ... verloading
but not in Java because it is not allowed.
but not in Java because it is not allowed.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: Bing [Bot] and 32 guests