Method:
1)In a class,method is to perform a opreation
2)A method can be used for a multiple object, which is created inside the
class
Method argument:
1)Passing the values to the parameter,while calling a method
Ex: objectname.method name(10,20);
Local variable:
1)It is a variable, which is inside the class and inside the method
2)Declare-It declares the variables inside the parameters of the
method
3)Assign-The values of the method argument were assigned to the
corresponding local variables
4)While assign the values,the value of the method argument
should have same datatype for the corresponding local variable
Static variable:
1)Static variable is a variable,it can be used anywhere inside the class
2)It can also access in another class by calling the class with a
variable name
(class name.variable name)
3)To create a static variable:
Static String variable name="";
Global variable:
1)It is a variable,it can access any method inside the class
2)Without calling any method,the variable can be directly
accessed inside the method
Top comments (0)