you pass variable(s) along to a new method without vs with variables.

parameter = same as variable in this context

NON-VS-PARAMETERIZED METHOD JAVA

Therefore,

NON-PARAMETERIZED (no variables) vs PARAMETERIZED (with variable(s))

Why do you have 2 types of methods?

Cuz, every variable in a method doesn’t exists in other methods!

method variables java

Sometimes you need a variable in multiple methods. Then you can pass the variable along like this:

void method1 () {
	int i = 10;
	method2(i);
}

void method2 (int i) {
	sum = i + 10;
}

SUM = 20.

Because you don’t always need this you can also use a: NON-PARAMETERIZED method

 

More Information on:

NON-PARAMETERIZED

PARAMETERIZED

for example how to write it and extra examples