import java.util.ArrayList;
class ObStack<T> extends ArrayList<T> {

  private static final long serialVersionUID = 1L;

  final T pop() {
    final int last = this.size() - 1;
    return this.remove(last);
  }

  final void push(final T O) {
    add(O);
  }

  final T peek() {
    return get(this.size() - 1);
  }
}


public class GeneriClass {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		ObStack<String> ob=new ObStack<String>();
		ob.push("insert 1");
		ob.push("insert 2");
		ob.push("insert 3");
		ob.push("insert 4");
		System.out.println("Top "+ob.peek());
		ob.pop();
        System.out.println("Top After Pop "+ob.peek());
	}

}


@@ -475,22 +475,16 @@
 b.push(%22
-insert
  1%22);%0A%09%09
@@ -492,22 +492,16 @@
 b.push(%22
-insert
  2%22);%0A%09%09
@@ -509,22 +509,16 @@
 b.push(%22
-insert
  3%22);%0A%09%09
@@ -530,15 +530,8 @@
 sh(%22
-insert 
 4%22);

Update Obstack.java