Skip to content
Advertisement

arrayImpOfStack.java how to reverse number in output?

I need to write arrayImpOfStack.java then write a main method to read a sequence of numbers and using the stack operation print them in reverse order

How to reverse number in output ?

I have 2 class

class 1

JavaScript

and i have class main

JavaScript

Advertisement

Answer

You can do it recursively:

JavaScript

In your case:

JavaScript

Full Example:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement