Explain about java.util NavigableSet Interface?


java.util 
Interface NavigableSet<E>

All Superinterfaces:

Collection<E>, Iterable<E>, Set<E>, SortedSet<E>

public interface NavigableSet<E>

extends SortedSet<E>

Since:

1.6

Methods of  NavigableSet interface :

1.E floor(E e)

Throws:

          ClassCastException 

          NullPointerException

2.E ceiling(E e)

Throws:

          ClassCastException 

          NullPointerException

3.E higher(E e)

Throws:

          ClassCastException 

          NullPointerException

4.E lower(E e)

Throws:

          ClassCastException 

          NullPointerException

5.E pollFirst()

6.E pollLast()

7.NavigableSet<E> headSet(E toElement,

                        boolean inclusive)

Throws:

           ClassCastException 

           NullPointerException 

           IllegalArgumentException

8.NavigableSet<E> tailSet(E fromElement,

                        boolean inclusive)

Throws:

           ClassCastException 

           NullPointerException 

           IllegalArgumentException

9.NavigableSet<E> subSet(E fromElement,

                       boolean fromInclusive,

                       E toElement,

                       boolean toInclusive)

Throws:

          ClassCastException 

          NullPointerException 

          IllegalArgumentException

10.NavigableSet<E> descendingSet()

11.SortedSet<E> headSet(E toElement)

Throws:

          ClassCastException 

          NullPointerException 

          IllegalArgumentException

12.SortedSet<E> tailSet(E fromElement)

Throws:

          ClassCastException 

          NullPointerException 

          IllegalArgumentException

13.SortedSet<E> subSet(E fromElement,

                    E toElement)

Throws:

          ClassCastException 

          NullPointerException 

          IllegalArgumentException

14.Iterator<E> descendingIterator()

15.Iterator<E> iterator()

 

Explain about java.util Interface Map?


java.util
Interface Map<K,V>

public interface Map<K,V>

Version:

1.2

Methods of Map Interface:

 1.V put(K key,V value)

 Throws:

  UnsupportedOperationException

   ClassCastException

   NullPointerException

   IllegalArgumentException

 2.void putAll(Map  m)

Throws:

UnsupportedOperationException

ClassCastException

NullPointerException

IllegalArgumentException

3.V get(Object key)

 Throws:

ClassCastException

NullPointerException

4. V remove(Object key)

Throws:

UnsupportedOperationException

ClassCastException

NullPointerException

5. void clear()

Throws:

UnsupportedOperationException

6. boolean containsKey(Object key)

Throws:

ClassCastException

NullPointerException

7. boolean isEmpty()

8.int size()

9.boolean containsValue(Object value)

Throws:

ClassCastException

NullPointerException

10.Set<K> keySet()

11.Collection<V> values()

12.Set<Map.Entry<K,V>> entrySet()

13.boolean equals(Object o)

14.int hashCode()

Explain about Collection Interface?


java.util
Interface Collection<E>

public interface Collection<E>

extends Iterable<E>

 Since:

1.2

Methods of Collection Interface :

boolean add(E e)

Throws:

UnsupportedOperationException 

ClassCastException

NullPointerException

IllegalArgumentException

IllegalStateException

boolean addAll(Collection c)

Throws:

UnsupportedOperationException

ClassCastException

NullPointerException

IllegalArgumentException

IllegalStateException

boolean remove(Object o)

Throws:

ClassCastException

NullPointerException

UnsupportedOperationException

boolean removeAll(Collection c)

Throws:

UnsupportedOperationException

ClassCastException

NullPointerException

boolean retainAll(Collection c)

Throws:

UnsupportedOperationException

ClassCastException

NullPointerException

boolean contains(Object o)

Throws:

ClassCastException

NullPointerException

boolean containsAll(Collection c)

Throws:

ClassCastException

NullPointerException

void clear()

Throws:

UnsupportedOperationException

boolean equals(Object o)

int hashCode()

int size()

boolean isEmpty()

Iterator<E> iterator()

Object[] toArray()

<T> T[] toArray(T[] a)

Throws:

ArrayStoreException

NullPointerException