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
can used Protected Class outside Function.?
Why string is a class?
Can we use catch statement for checked exceptions?
Is void a data type?
Can a static block throw exception?
What is string syntax?
Who is founder of java?
What is int lol?
What is java virtual machine and how it is considered in context of java’s platform independent feature?
I want my class to be developed in such a way that no other class (even derived class) can create its objects. How can I do so?
Which container method is used to cause a container to be laid out and redisplayed in java programming?
Does java support function overloading, pointers, structures, unions or linked lists?
Explain the purpose of garbage collection in Java?
What is methods and methodology?
Can we assign null to double in java?