
Jared G. answered 05/20/21
Experienced in Computer Science
Hello Karanbir,
If you would like to access the array only within the Main() function, you can put it at the beginning of the function like so:
Additionally, I noticed some other errors that you should take a look at. I have not run the code, so I may not have caught them all, but these should be corrected at the very least.
Your main function and class should be declared as public
Your int variables should be either initialized or you should simply put int before the variable names the first time they are used and remove the duplicate declarations.