MCPcopy Create free account
hub / github.com/apna-college/Alpha / main

Method main

13_Stacks/Question2.java:5–22  ·  view source on GitHub ↗
(String args[])

Source from the content-addressed store, hash-verified

3
4public class Question2 {
5 public static void main(String args[]) {
6 String str = "HelloWorld";
7
8 Stack<Character> s = new Stack<>();
9
10 int i=0;
11 while(i<str.length()) {
12 s.push(str.charAt(i));
13 i++;
14 }
15
16 StringBuilder result = new StringBuilder("");
17 while(!s.isEmpty()) {
18 result.append(s.pop());
19 }
20 str = result.toString();
21 System.out.println(str);
22 }
23}

Callers

nothing calls this directly

Calls 3

pushMethod · 0.95
isEmptyMethod · 0.95
popMethod · 0.95

Tested by

no test coverage detected