listing stacks and queues continued string inputoutputwhile(truesystem out print("enter string")system out flush()input getstring()/read string from kbd ifinput equals(""/quit if [enterbreak/make reverser reverser thereverser new reverser(input)output thereverser dorev()/use it system out println("reversedoutput)/end while /end main(//public static string getstring(throws ioexception inputstreamreader isr new inputstreamreader(system in)bufferedreader br new bufferedreader(isr)string br readline()return ///end class reverseapp ///////////////////////////////////////////////////////////////we've created class reverser to handle the reversing of the input string its key component is the method dorev()which carries out the reversalusing stack the stack is created within dorev()which sizes the stack according to the length of the input string in main(we get string from the usercreate reverser object with this string as an argument to the constructorcall this object' dorev(methodand display the return valuewhich is the reversed string here' some sample interaction with the programenter stringpart reversedtrap enter string