Arrays as arguments | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Arrays as arguments

Is it possible to make a method/function of, as example, type int[] (I mean an array of integers) and with an argument of the same type? And if it is possible, how does it work (what's the syntax)?

9th Jul 2018, 10:36 AM
Joel Kronqvist
Joel Kronqvist - avatar
2 Answers
+ 1
Just put the type with square brackets e.g. int[] https://code.sololearn.com/cbBjnt3WPX6w/?ref=app
9th Jul 2018, 1:01 PM
TurtleShell
TurtleShell - avatar
0
Thank you, TurtleShell. This helped much.
9th Jul 2018, 1:51 PM
Joel Kronqvist
Joel Kronqvist - avatar