Skip to main content
Formatting
Source Link
Ole Pannier
  • 3.8k
  • 9
  • 26
  • 35

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

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

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

In this Program you want to use count, so declare count method as a static

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

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

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