answersLogoWhite

0


Best Answer

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

User Avatar

Wiki User

16y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

Operator overloading is not possible in Java.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Operator overloading is possible in java or not?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

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..... === === === ===


What is operator overloading?

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.


What are the differences between Java OOP and PHP OOP?

JAVA is an Object Based Programming Language. it doesn't provide multiple inheritance and operator overloading. while Object Oriented Lanuages provides both.


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.


Why do you use of operator overloading in c?

Overloading, Overriding, Polymorphism, Information Hiding, Inheritance all these are CONCEPTS of C++ and Java. An Object Oriented Language and not of C language. Thats why Bjarne Stroustrup came up with C++ ...

Related questions

Is it possible to do operator overloading in c?

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


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 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..... === === === ===


What is a operator overriding in java?

Java does not support object overriding. It does support operator overloading by means of the "+" symbol which is used for both numeric addition as well as string concatenation.


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.


How can you create a new operator through operator overloading?

You cannot create a new operator through operator overloading. You can only redefine an existing operator, with certain limitations. As an example, for a class of complex numbers, having a real and an imaginary part, you might want an addition operator. This is the skeleton of code to do that. I only show the operator, not any constructors or other operators or methods, etc.class complex {private:double real, imaginary;public:complex operator+ (complex operand) {complex temp;temp.real = this.real + operand.real;temp.imaginary = this.imaginary + operand.imaginary;return temp;}};The above answer is for C++. Since this question is also categorized in Java Programming it's important to note that operator overloading is not currently possible in Java.


What is operator overloading?

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.


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 }


What are the differences between Java OOP and PHP OOP?

JAVA is an Object Based Programming Language. it doesn't provide multiple inheritance and operator overloading. while Object Oriented Lanuages provides both.


Is it possible to use operator overriding in java?

short answer: no longer answer: 10 seconds on google would get you to http://java.sun.com/docs/white/langenv/Simple.doc2.html There are no means provided by which programmers can overload the standard arithmetic operators. Once again, the effects of operator overloading can be just as easily achieved by declaring a class, appropriate instance variables, and appropriate methods to manipulate those variables. Eliminating operator overloading leads to great simplification of code.


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.


Is it possible to define two methods that have the same name but different parameters?

Yes. It is called Method Overloading in Java