answersLogoWhite

0

Overloading is very useful in Java. For instance, methods can be overload as long as the type or number of parameters (arguments) differ for each version of the method. This comes in handy when, for instance, you need to perform a complex mathematical operation, but sometimes need to do it with two numbers and sometimes three, etc.

User Avatar

Wiki User

∙ 18y ago

What else can I help you with?

Related Questions

Operator overloading is possible in java or not?

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


Why java not support oprator overloading?

Pressumably, the designers of Java thought this would lead to confusing code.


How many constructor can be defined in a classin java p rogramming?

how many constructer can be defined in class in overloading of java programming


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


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.


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.


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.


What is the function of this in java?

this in java is a keyword that refers to the current object of the class. It is also used in constructor overloading when you want to invoke one constructor from another within the same class.


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

Yes. It is called Method Overloading in Java


What is the use of overloading in java?

method overloading is the primary way polymorphism is implemented in JavaOverloading methodsoverloaded methods: appear in the same class or a subclasshave the same name but,have different parameter lists, and,can have different return types


What is method overriding and overloading in java?

Overloading is the means by which we can provide two or more different definitions of the same method in the same namespace. Overriding is the means by which a derived class may redefine the meaning of a base class method.


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.

Trending Questions
A sentence with the word trustworthy? Describe the characteristics of the voltage amperage and resistance when there is more than one load in a parallel circuit? How years in college would it take to become a fashion designer? How do you remove the whitespaces above and below the list items that come when we create a UL in HTML? What is the command to turn off the PF Keys for a Main Frame programmer? How many cement blocks can be made from 1 cube of sand? How would you flush yourself down the toilet? Why does the magnetizing curve of shunt generator tend to become horizontal after a certain value of field current? What resistance is necessary to operate a 3 amp device in a 12 volt system? Which type of ladder is non self-supporting has one section and has a fixed length which is determined by the length of the side rails? How do you determine the flexural rigidity of a beam? What is the difference between an open delta and an open wye connection? State rankings in education? When inspecting boilers you should operate the what? What is the unit for measuring electric current called? What is the effect of age of concrete upon the water-cement ratio and strength curve? Explain why design conflicts might arise when designing an architecture where availability and security requirements are the most important functional requirements? Can you accelerate a stationary charged particle witha magnetic field or an electric field and please explain? How many amps for a 200 kva 3 phase generator working on 240 V per phase? What are symbolic constants and how they are useful in developing programs?