In this Program you want to use count, so declare count method as a static class MyProgram
{ int count = 0; public static void main(String[] args) { System.out.println(count); } }
class MyProgram<br> { int count = 0; public static void main(String[] args) { System.out.println(count); } } Hear you can declare this method as a public private and protected also. If you are using this method you can create a secure application.
class MyProgram { static int count = 0; public static void main(String[] args) { System.out.println(count); } }
class MyProgram { static int count = 0; public static void main(String[] args) { System.out.println(count); } }