what is overloading in java?
Answer Posted / rajesh bonepalli
Overloading in java means creating the methods by same
method signature(name,return type) passing different
arguments/parameters.
Example :
public class Children {
public void getHabits(int k){
System.out.println("overriding in the children with
childrens behaviour int");
}
public void getHabits(){
System.out.println("overriding in the children with
childrens behaviour");
}
public void getHabits(double j){
System.out.println("overriding in the children with
childrens behaviour double");
}
public String getHabits(double j,double i){
System.out.println("overriding in the children with
childrens behaviour double");
return null;
}
}
Is This Answer Correct ? | 7 Yes | 1 No |
Post New Answer View All Answers
Explain about main thread in java?
Differece between class and generic class?
Is ++ operator is thread safe in java?
what is the final keyword denotes in java?
What is the purpose of a parameter?
Differences between traditional programming language and object oriented programming language?
How do you get length in java?
Is array serializable java?
What data structures are used to perform recursion?
Is array an object in java?
Can we override static methods in java?
What does flag mean in java?
How do you check if a string contains only numeric digits?
Is char * a string?
How to add menushortcut to menu item?