/** * Call without Parameter to Method * error: variable a is already defined in method test(int) */ class NoParameterDeclaration { public static void main(String[] args) { /*there is no parameter given here*/ testObj.test(); } public void test (int i) { int a = i; } }