javap command is stand for java parsing .you can see public and protected method for a particular library class.
Take an example To see all the protected and public method of ArrayList, we have to execute below command
->javap java.util.ArrayList
output:
Compiled from "ArrayList.java"
public class java.util.ArrayList extends java.util.AbstractList implements java.util.List,java.util.RandomAccess,java.lang.Cloneable,java.io.Serializable{
public java.util.ArrayList(int);
public java.util.ArrayList();
public java.util.ArrayList(java.util.Collection);
public void trimToSize();
public void ensureCapacity(int);
public int size();
public boolean isEmpty();
public boolean contains(java.lang.Object);
public int indexOf(java.lang.Object);
public int lastIndexOf(java.lang.Object);
public java.lang.Object clone();
public java.lang.Object[] toArray();
public java.lang.Object[] toArray(java.lang.Object[]);
public java.lang.Object get(int);
public java.lang.Object set(int, java.lang.Object);
public boolean add(java.lang.Object);
public void add(int, java.lang.Object);
public java.lang.Object remove(int);
public boolean remove(java.lang.Object);
public void clear();
public boolean addAll(java.util.Collection);
public boolean addAll(int, java.util.Collection);
protected void removeRange(int, int);
}
Take an example To see all the protected and public method of ArrayList, we have to execute below command
->javap java.util.ArrayList
output:
Compiled from "ArrayList.java"
public class java.util.ArrayList extends java.util.AbstractList implements java.util.List,java.util.RandomAccess,java.lang.Cloneable,java.io.Serializable{
public java.util.ArrayList(int);
public java.util.ArrayList();
public java.util.ArrayList(java.util.Collection);
public void trimToSize();
public void ensureCapacity(int);
public int size();
public boolean isEmpty();
public boolean contains(java.lang.Object);
public int indexOf(java.lang.Object);
public int lastIndexOf(java.lang.Object);
public java.lang.Object clone();
public java.lang.Object[] toArray();
public java.lang.Object[] toArray(java.lang.Object[]);
public java.lang.Object get(int);
public java.lang.Object set(int, java.lang.Object);
public boolean add(java.lang.Object);
public void add(int, java.lang.Object);
public java.lang.Object remove(int);
public boolean remove(java.lang.Object);
public void clear();
public boolean addAll(java.util.Collection);
public boolean addAll(int, java.util.Collection);
protected void removeRange(int, int);
}
This comment has been removed by a blog administrator.
ReplyDelete