HCL Interview Question
Software Engineer / DevelopersThe operator overloading is comes under the category of Polymorphism. The meaning of the Polymorphism is same things use at different form. Generally we have two type of polymorphism.
1. Run time polymorphism
2.compile time polymorphisam
operator overloading comes under run time polymorphism.
Ex:
take (+) operator in java.
it uses in two ways.
1.adding two integer number.
2.concatenating two string values.
A method signature is part of the method declaration. It is the combination of the method name and the parameter list.
- Mohan K @ DSM Soft,Trichy September 11, 2013Ex:
public static void main(String args[])
The method signature for the main() method contains three modifiers:
public -- indicates that the main() method can be called by any object,
static -- indicates that the main() method is a class method(Without object we can call using Class name),
void -- indicates that the main() method has no return value.