what is object overloading in java?
overloading in java
Collapse
X
-
In A Class When There Are More Than One Method With The Same Name With Different Parameters And Same Or Different Return Type Then Metods Are Said To Be Overloading.the Differance Between Overloading And Overriding Is Overriding Means Relation Between Super Class And Subclass In Overriding Method Signature Must Be Same Including Return Type.in Overloading Method Signature Should Differ.in Overriding It Blocks Inheritance.ove rloading Means Mehods Available In The Same Class. Overriding Means Relation Between Super Class Method And Subclass Method GiribabuComment
-
As of 1.5 you can override a method with one that has a return type which is a subclass of the parent class methodOriginally posted by GUNDALA GIRIBABUIn A Class When There Are More Than One Method With The Same Name With Different Parameters And Same Or Different Return Type Then Metods Are Said To Be Overloading.the Differance Between Overloading And Overriding Is Overriding Means Relation Between Super Class And Subclass In Overriding Method Signature Must Be Same Including Return Type.in Overloading Method Signature Should Differ.in Overriding It Blocks Inheritance.ove rloading Means Mehods Available In The Same Class. Overriding Means Relation Between Super Class Method And Subclass Method Giribabu
Compiles fine in 1.5 but not on 1.4 compilersCode:class A { public Number a() { return 1; } } class B extends A { public Integer a() { return 1; } }Comment
Comment