Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners STACK - WHY THE OUTPUT COMES LIKE THIS?

Have Programming Question? Ask it here!
 
 
 


Mohamed Rafi
STACK - WHY THE OUTPUT COMES LIKE THIS?
0 Answer(s)      3 years and 4 months ago
Posted in : Java Beginners


//: holding/StackTest.java import net.mindview.util.*;

public class StackTest { public static void main(String[] args) { Stack<String> stack = new Stack<String>(); for(String s : "My dog has fleas".split(" ")) stack.push(s); while(!stack.empty()) System.out.print(stack.pop() + " "); } } /* Output: fleas has dog My

WHY THE OUTPUT COMES LIKE THIS?


Advertisement
View Answers

Related Tutorials/Questions & Answers:
Advertisements
 

 

 

DMCA.com