how to return an array from a method (Beginning Java forum at JavaRanch)

how to return an array from a method (Beginning Java forum at JavaRanch)

瀏覽:1358
日期:2024-08-31
Your problem isn't with the "return", it's with the earlier declaration of variable "a" and the declaration of the method. In both cases, you declared it as "int", but it is [a reference to] an array, so should have been declared "int[]". Once your method...看更多