Method Method declares executable code that can be evoked by passing fix number of values Method statement Public static (Both are declaring modifiers ) + return type or void + method name ( set of arguement values or parameters ) Method Overloading Multiple methods with same name but having different set of parameters Method signature consists of name of method and uniqueness of declaring parameters Parameters name is important in determining overloaded method return type also.
Constructor is used for creating object i.e an instance of class Constructor can be overloaded by defining constructor with different formal parameters or arguements. If parameters are same in two constructors then their order must be different. Constructor chaining can be done by constructor overloading It can be done by using this keyword
Comments