• Post Reply Bookmark Topic Watch Topic
  • New Topic

Function Overloading  RSS feed

 
binayakumar patel
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have doubt in function overloading
Here is an example:

public class A{
public int calculate(int I, int j){}
public String calculate(String s, String s1){}
}

Class B extends A{
public float calculate(float a, float b){}
}

It is clear that in class A the method calculate() is overloaded. In same way when B is inheriting class A the calculate() methods also get inherited to class B . Can we say that calculate() of class A is overloaded in class B ??
 
Chiranjeevi Kanthraj
Ranch Hand
Posts: 290
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
binayakumar patel wrote:when B is inheriting class A the calculate() methods also get inherited to class B


Yes you can say its overloading
 
praveen macherla
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes we can say it is overloaded.
 
Campbell Ritchie
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch praveen macherla
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!