#CoreJava/MethodsInJava

What is Method?

?

Naming Convention a Method
Method Calling & Method Declaration Syntax

?

class ClassName{
	public static void main(String[] args){
		ClassName objectName = new ClassName();
		// Method Calling
		objectName.methodName();
	}

	// Method Signature
	returnType dataType methodName(){
		// set of instruction
		return ;
	}
}

Example:

class Calculator{
	public static void main(String[] args){
		Calculator casio = new Calculator();
		// Method Calling
		int result = casio.add(4,5);
		System.out.println(result);
	}

	// Method Signature
	int add(int num1, int num2){
		// Method Defination
		int c = num1 + num2;
		return c;
	}
}
How many types of methods in java?

?

Main Method

Method means activity.
Important Activity - Main Method