When you post code, please
UseCodeTags. It'll make your problem much easier to understand. I added them for you this time.
I'm not quite sure what your main method is supposed to do. You first seem to be attempting to call the printLargestAndSmallestElements() method, which makes no sense because there's nothing yet to call it on. Even so,
you should call it on a variable or a value, not on a variable declaration. To make it legal, remove the int[] part, and declare n before you make the method call.
You then declare n (which you should really do first) and "initialize" it by setting every element to 0. This is unnecessary, because an array always initializes all its elements to 0 or null when you create it.
If you're trying to create an array of random values, and then print the largest and smallest elements, you can do something like this: