473,327 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

overloading in java

what is object overloading in java?
Jan 8 '07 #1
3 3179
r035198x
13,262 8TB
what is object overloading in java?
It is called method overloading and is when you have 2 or more methods in the same class with the same name but taking different number and or types of arguments
Jan 8 '07 #2
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.overloading Means Mehods Available In The Same Class. Overriding Means Relation Between Super Class Method And Subclass Method Giribabu
Jan 10 '07 #3
r035198x
13,262 8TB
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.overloading Means Mehods Available In The Same Class. Overriding Means Relation Between Super Class Method And Subclass Method Giribabu
As of 1.5 you can override a method with one that has a return type which is a subclass of the parent class method

Expand|Select|Wrap|Line Numbers
  1.  
  2. class A {
  3.  public Number a() {
  4.   return 1;
  5.  }
  6. }
  7. class B extends A {
  8.  public Integer a() {
  9.   return 1;
  10.  }
  11. }
  12.  
Compiles fine in 1.5 but not on 1.4 compilers
Jan 10 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

17
by: Terje Slettebø | last post by:
To round off my trilogy of "why"'s about PHP... :) If this subject have been discussed before, I'd appreciate a pointer to it. I again haven't found it in a search of the PHP groups. The PHP...
7
by: Doran_Dermot | last post by:
Hi All, I've seen lots of code in which the attributes of a class are accessed and modified using two separate methods. For example: class Problems: def __init__( self, refNum ):...
3
by: E. Robert Tisdale | last post by:
Something that calls itself Paul Fame wrote: > In my University course teaching Java, my lecturer just claimed that > operator overloading in C++ was a mistake and that > Java's lack of operator...
6
by: james b | last post by:
Hi all, I'm trying to do something with method overloading and I can't seem to get it to work my code is along the lines of public int method1(int a, int b, int c){ //method body } public...
2
by: Iter | last post by:
Hi Guys, In my company, we have java application which is runing in unix platform, and we have web service application build by microsoft .net runing in IIS in microsoft windows 2000 platform....
3
by: toton | last post by:
Operator overloading has a sort syntax rather than member function call for stack based memory allocation. like complex<int> c1,c2,c3; c3= c1+c2; How the same can be applied to heap based...
10
by: Mihai Osian | last post by:
Hi everyone, Given the code below, can anyone tell me: a) Is this normal behaviour ? b) If it is, what is the reason behind it ? I would expect the A::method(int) to be inherited by B. ...
11
by: placid | last post by:
Hi all, Is it possible to be able to do the following in Python? class Test: def __init__(self): pass def puts(self, str): print str
1
by: peridian | last post by:
This is more of a general question, but I didn't know where to post it. Since Java is an example of a language which does this, I thought here would work. Coming from a C++ background, having...
10
by: Matthew | last post by:
Am I correct in thinking there is no method/function overloading of any kind in any version of PHP? Thanks, Matthew
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.