Question: How would you call each method in the main? I am struggling to figure it out using Java. - Method in the ArrayStack class (
How would you call each method in the main? I am struggling to figure it out using Java.
Method in the ArrayStack class name it numValues this method return the number of elements stored in the Stack not the capacity
Method in the ArrayStack class name it printStack this method prints the elements in the Stack in reverse order
Method in the Demo class name it reverseString call the method from the main and pass a string to it This method will do the following:
Receives a string sentence not just one word
Stores the received string in an arraybased stack
Prints the sentence in reverse.
Example:
Call statement: reverseStringTesting my reverseString method";
output: dohtem gnirtSesrever ym gnitseT
Method in the Demo class name it reverseNumber call the method from the main and pass an integer to it This method will do the following:
Receives an integer.
Stores the received integer in an arraybased stack
Prints the integer in reverse.
Example:
Call statement: reverseNumber;
output:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
