Home » Java Programming » Declarations and Access Control

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); } }

← Previous Next →

Discussion & Comments

No comments yet. Be the first to comment!