Why isn’t there operator overloading?



Why isn’t there operator overloading?..

Answer / Chetan Singh Kushwaha

"Java does not support operator overloading to maintain a consistent syntax across all objects and built-in data types. Operator overloading can lead to confusion about the meaning of operators for different classes, which would make the language harder to learn and use. Instead, Java provides methods that can mimic some aspects of operator overloading, such as custom math functions like add(), subtract(), multiply() etc.n

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

when System.out.println("") is executed what happens in the back ground?

2 Answers  


What does java stand for?

1 Answers  


What is an exception?

6 Answers  


Explain about anonymous inner classes in java?

1 Answers  


what is difference between abstract factory and factory design patterns?

0 Answers  


what is the difference between yielding and sleeping? : Java thread

1 Answers  


What is floor in java?

1 Answers  


Explain Basics of OOP Language in java

1 Answers   Atos Origin,


How can a class be accessed, If no access modifiers are declared?

4 Answers  


What is java class writing rules?

1 Answers   Oracle,


Can a class be private or protected in java?

1 Answers  


What is an example of declaration?

1 Answers  


Categories