Im a beginner in java and starting to do test driven development. I have a pretty basic scenario i am stuck with. I want to pass a string of numbers from 1 to x. i.e if x is 3, it will return “1, 2, 3” or if x is 5, it will return “1, 2, 3, 4, 5”.
I know that i need to use an array list and a for loop but am stuck with the syntax. Someone please help!
Thanks
Try the following code: