QA's approach 2 Java - Methods in Java
Methods in Java: 1. Used to expose the behaviour of the objects 2. Used to perform an action and would or wouldn't return any outcome for that action. Examples: Click() ->Doesn't require any outcome of the action. Display()-> Require the action to display an output to some terminal. GetBalance()->Require the action to fetch the Balance of the customer. Method signature: [With or Without Return type] Method(with or without parameters) { ------------- --------------- [With or Without Return statement;] } Method Parameters can be of primitive, reference type, variable arguments or array types 1. method(Primitive type) Display(Int a) 2. method(Reference type) display(String s) display(Student s1) display(Student a[]) display(Object obj[]) 3. method(Collection object) 4. method(String args...) Variable no of arguments passing...