// methods1 DIS class Test { int i; int j = 1; void print() { System.out.println("i: " + i); System.out.println("j: " + j); } int data(int a, int b) { i += a; j += b; return i+j; } } public class methods1 { public static void main(String[] args) { Test t = new Test(); t.print(); int a = 1; int b = 2; int c = t.data(a,b); t.print(); System.out.println(c); } } /* output i: 0 j: 1 i: 1 j: 3 4 */