What restrictions are placed on method overloading?
Answer / Kunjan Bharti
For method overloading, there are no restrictions on the number of parameters or their types. However, the parameter names can be the same and should have different data types or the same data type with a different order. Also, the return type can be the same but should not be void.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is considered an anti pattern?
INTERVIEW QUESTION FOR ANDROID
What is the immediate superclass of Menu?
What are legal modifiers that we can use to declare an inner class?
How are destructors defined in java?
What is the purpose of the System class?
In case of inheritance what is the execution order of constructor and destructor?
What does compareto () do in java?
Why does java not support operator overloading?
If I will write String s=new String("XYZ"); String s1=new String("XYZ"); if(s.equals(s1)){ sop("True"); } else{ sop("False"); } This program will give me "True". But When I am creating my own class suppose class Employee{ public Employee(String name); } Employee e= new Employee("XYZ"); Employee e1 = neew Employee("XYZ"); if(e.equals(e1)){ sop("True"); } else{ sop("False"); } Then it will give the output as "False". Can I know what is happening internally?
What classes can be used to store arbitrary number of objects ?
Can extern variables be initialized?