i have a question--- i have to implement arraylist by using array.
and i m using following approach-

package DS;

import java.lang.reflect.Array;

public class ArrayList<T> {
	T ob[];

	public ArrayList(Class<T []> c, int s) {
		// Use Array native method to create arra of a type only known at run
		// time
		ob = c.cast( Array.newInstance(c.getComponentType(), s));

	void addItem(T item)
			for(int i=0;i<ob.length;i++)
		ArrayList a=new ArrayList(T.class, ob.length);

	boolean isFull(int i) {

		if (ob[i] == null) {
			return false;

		return true;

what is prob in the line (red line)...there is no error if i write is for String.

Please copy and paste here the full text of the error message.

Use ob.getClass() ? rather than T.class

I think Generics types only exist at compile time.
Read the Tutorial for more information.