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: 10398
- 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.
Who is online
Users browsing this forum: No registered users and 14 guests