answersLogoWhite

0

What is operator overloading?

Updated: 8/10/2023
User Avatar

Wiki User

8y ago

Best Answer

I think you mean operation overlord??? It is the American, Canadian and British offensive on Europe in World War 2. They landed in Normandy on 6th June 1944 (Commonly called D-Day, Day of Days or Deliverance Day) and progressed throughout France liberating Paris on the 25th August. This allowed the allies a foothold in Europe.

User Avatar

Quinton Schimmel

Lvl 10
1y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

8y ago

Operator overloading allows us to provide new implementations for existing operators. Not all languages support operator overloading; C does not, but C++ does. All languages provide built-in operators, however these operators cannot cater for user-defined types (they only work on built-in types). Operator overloading allows us to add this (missing) functionality so we can operate upon user-defined types as intuitively as we can with built-in types. In languages that do not support operator overloading, user-defined functions can be used instead of operators, but they are much less intuitive.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

There is no concept of operator overloading in java, at least it is not available to the developers. There are still instances of operator overloading as in the case of "+" operator. It is used both to perform arithmetic sum as well as concatenation of two strings.

But one cannot impart additional functions to an existing operator as in the case of C++.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

I think you mean operation overlord??? It is the American, Canadian and British offensive on Europe in World War 2. They landed in Normandy on 6th June 1944 (Commonly called D-Day, Day of Days or Deliverance Day) and progressed throughout France liberating Paris on the 25th August. This allowed the allies a foothold in Europe.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

Java does not support operator overloading. Operator overloading is the scenario where you overload a particular operator to do something that it is not designed to do.

Ex: if you make the operator "*" do addition or the operator "-" do multiplication, imagine the chaos that would ensue in your program. So the java designers blocked this feature of operator overloading.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

Operator overloading refers to redefining what the mathematical operators (+-*/) do when applied to different objects.

Java does not support operator overloading.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is operator overloading?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Operator overloading is possible in java or not?

Java does not support opperator overloading, so the answer to your question is: none.


How operator overloading differ from function overloading?

Function overloading is multiple definition with different signatures(the parameters should be different) for the same function. The parameter list have to be different in each definition. The compiler will not accept if the return type alone is changed. Operator overloading is defining a function for a particular operator. The operator loading function can not be overloaded through function overloading.


How can you differentiate overloading of pre-fix and post-fix increment operator?

The prefix increment operator is overloaded as operator++() while the postfix increment operator is overloaded as operator++(int).


What are the disadvantage of operator overloading?

The only disadvantage of operator overloading is when it is used non-intuitively. All operators must behave with predictable results, thus it makes no sense to implement the plus (+) operator so that it behaves like a subtract (-) operator, or a multiply (*) operator, or indeed anything other than the intuitive sum of two objects.


How do you find largest of two object using operator overloading in c?

I will not use operator overloading in C# to do anything. Operator overloading may lead to one operator has more than 1 semantic meaning. For example, we know 1 + 2 yields 3, and "1" + 2 yields "12". I do not like this overloading of the operator + being used for addition in Number hierarchy, while as the concatenation in strings. That is, one operator (+) has 2 significant semantics.And the question "find largest of two object" is too vague - what do you mean "largest"? and object? We know apple and orange are 2 objects, but how do you compare them, and find the largest one?????? (size, price or what???)

Related questions

Is it possible to do operator overloading in c?

No. Operator and/or function overloading is only a C++ thing.


Operator overloading is possible in java or not?

Java does not support opperator overloading, so the answer to your question is: none.


C coding for operator overloading?

C does not support operator overloading. If you mean C++ operator overloading, it depends on exactly what you wanted to do. If you wanted to '+' to strings, then you could write: string operator+(string a, string b) { // do something }


When an operator works on various type of operands is called?

operator overloading


How operator overloading differ from function overloading?

Function overloading is multiple definition with different signatures(the parameters should be different) for the same function. The parameter list have to be different in each definition. The compiler will not accept if the return type alone is changed. Operator overloading is defining a function for a particular operator. The operator loading function can not be overloaded through function overloading.


How can you differentiate overloading of pre-fix and post-fix increment operator?

The prefix increment operator is overloaded as operator++() while the postfix increment operator is overloaded as operator++(int).


What are the disadvantage of operator overloading?

The only disadvantage of operator overloading is when it is used non-intuitively. All operators must behave with predictable results, thus it makes no sense to implement the plus (+) operator so that it behaves like a subtract (-) operator, or a multiply (*) operator, or indeed anything other than the intuitive sum of two objects.


What is an operator overloading in C?

one function but multiple behaviours depending on the parameters


How do you find largest of two object using operator overloading in c?

I will not use operator overloading in C# to do anything. Operator overloading may lead to one operator has more than 1 semantic meaning. For example, we know 1 + 2 yields 3, and "1" + 2 yields "12". I do not like this overloading of the operator + being used for addition in Number hierarchy, while as the concatenation in strings. That is, one operator (+) has 2 significant semantics.And the question "find largest of two object" is too vague - what do you mean "largest"? and object? We know apple and orange are 2 objects, but how do you compare them, and find the largest one?????? (size, price or what???)


What are the restriction that are applied to operator overloading?

Java does not support user defined operator overloading.The operator '+' is overloaded in Java and can be used for adding both numbers and Strings.


Why java not support operator overloading?

Maybe because Sun said so. We have to bear with so many other idiosyncrasies too. But I guess that comes with every language. There were two major reasons why operator overloading wasn't allowed in Java: "cleanliness" and compiler complexity. The main reason was the first, a personal preference choice made by Java's creator, James Gosling. Operator overloading, while useful, can be exceedingly confusing, much more so than method overloading. Given the human tendency to assign specific meanings to single symbols, it is hard to get programmers to wrap their heads around multiple meanings for operators. What this means is that there is a marked increase in programming errors when a language supports operator overloading. Since practically the same benefit can be obtained via methods, the Java designers decided that the increased programmer mistake rate was not worth supporting operator overloading. From a Java compiler (e.g. javac) design standpoint, supporting operator overloading is considerably more difficult than method overloading, requiring a more complex compiler.


Why operator overloading is not there in java?

== == === === === === === === Some Body told me that operator overloading is not there because it violates the transparency of java.since there is no hiding of information in java it does support op overloading === === === === === === Pranab Kumar Rana Software Engineer..... === === === ===