Well, good for you then.
Type: Posts; User: Abhilash
Well, good for you then.
Actually, by garbage value I means the array does no store anything for now (i.e. it hasn't been initialized in the program). Although java initializes it automatically, but this method shouldn't be...
Because Your array stores "garbage value" for now. You haven't initialized it with numbers, you have just declared it. So it prints 0 as default.
String args[], not a[]. You are not initializing an array within the parameters.
Moreover, your array r is uninitialized. Initialize it with numbers before printing it.