Why the program use the method " public static int[] initializeArray() "? it is confused me.
it would not be easier to put it directly in the main method by omitting this method
i found the solution but i have a ask
Under discussion
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
Guadalupe Gagnon
26 December 2019, 14:52
This task is demonstrating different uses of methods. In object oriented programming (OOP) you don't want all your code in the 'main' method. Using different classes and methods makes the code more robust and easier to debug in later stages. So while these tasks don't necessarily demonstrate the full power of OOP , they start introducing you to the some concepts gently.
+2
LucGar
26 December 2019, 20:53
Thanks a lot
0