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
What is the super void?
How do you take thread dump in java?
What is a values collection view ?
Is array an object in java?
How listener identify that the event came from a particular object?
How do you start a new line in java?
Can we restart a thread already started in java?
What is a parameter in java?
What is the difference between jfc & wfc?
Why arraylist is used in java?
what is the messsage u r going to get from an objectoriented programing?
What is get () in java?
How to split a string in java?
What is java lang string?
How do you declare an empty string?