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 do you mean by aggregation?
What is the default value of an object reference declared as an instance variable?
What are data types in oop?
Differentiate between array list and vector in java.
What is difference between public static and void?
Can static methods access instance variables in java?
What do you mean by mnemonics?
Explain where variables are created in memory?
How many techniques can be employed to create a string object?
What are the kinds of polymorphism?
What is the unit of plancks constant?
What is procedure writing?
Can a java program have 2 main methods?
Can we assign integer value to char in java?
What is reflexive association?