What will be the output of the program public class Test { public int aMethod() { static int i = 0; i++; return i; } public static void main(String args[]) { Test test = new Test(); test.aMethod(); int j = test.aMethod(); System.out.println(j); } }

Comments and Answers (2)

Lalit

Lalit

What is the correct solution?

Richa

Richa

does anyone know the correct answer

Avatar

{{SampleComment.userName || "Your Name"}} ~ {{SampleComment.userCity}}

{{SampleComment.commentValue || "Your Answer or Comment goes here...."}}