How to write recursive method that takes an array of Strings and prints them out in reverse order, one per line.

I was able to do this by iteration but not by recursion since its an array of string .could any one help me ...

How to write recursive method that takes an array of Strings and prints them out in reverse order, one per line.

I was able to do this by iteration but not by recursion since its an array of string .could any one help me ...

you accept a String array as an argument, within your method, print the last element, create a new array that contains all the elements of the original array, without the last one, and pass that on to the method

stop running the method once your array contains zero elements

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.