Stack capacity and hascode
example

import java.io.*;
import java.util.List;
import java.util.*;// Arrays.sort
import java.util.ArrayList;
import java.util.Stack;
//import java.util.Queue.*;// Queue
public class Test_This {
public static void main(String[] args) throws IOException{
// TODO Auto-generated method stub
Process p1 = new Process();
p1.method_1();
}
}
class Process
{
//String[] first = {"a","e", "c","b","d"};
String[] second = {"0.0","0.1", "0.2","0.3","0.4"};

public Process()
{
System.out.println("Default) constructor");
}
public void method_1()
{
//Queue list = new LinkedList();
//System.out.println("Sort arrays ");
Stack s = new Stack();
System.out.println("-----loading Stack--------");
for(int i = 0; i < second.length; i++)
{
s.push(second[i]);
}
System.out.println("Print stack capacity " + s.capacity());
System.out.println("Print stack hascode() " + s.hashCode());
System.out.println("Print stack " + s);
System.out.println("-------------");
System.out.println("--First Come Last Out, Last In First Out---- " );
int count = s.search("0.2");
for(int i = 0; i <second.length; i ++)
{
if (count ==i)
{
System.out.println("-------------");
System.out.println("\t\tFound 0.02 after :" + s.toString() + " at : " + i);
s.pop();
System.out.println("-------------");
}

else { System.out.println("Stack Peek first item: " + s.peek());
System.out.println("\tStack Pop first item: "+ s.pop());}
if(s.empty()){ System.out.println("Stack is Empty");}
}
}
}