enfrptes

sendassignment@tutorspoint.com

Set Interface Homework Help

Tutorspoint.com is an excellent site, which caters to all queries of programming students, regarding java assignments related to topics like Set Interface homework help with quality solutions.

Since Java Assignment writing help is offered at reasonable rates, Tutorspoint is highly recommended by students worldwide.

 

What do you mean by the Set interface?
The set interface defines a set. It also extends collections. It declares the behavior of a collection that does not allow duplicate elements. In this interface add () method returns false if an attempt is made to duplicate elements to a set. A set interface does not define any additional methods of its own.

 

The sorted set interface is as follows:

a) The sorted set interface extends the set interface.

b) It declares the behavior of a set sorted in ascending order.

c) In addition to those methods defined by the set, the sorted set interface declares the following methods.

 

Comparator ():

Returns the invoking sorted sets comparator, if the natural ordering is used for the set, null is returned.

 

Objectfirst ():

This returns the first element in the invoking sorted set.

 

Sorted set headset (object end):

Returns a sorted set containing those elements less than the end that is contained in the invoking sorted set. Elements in the returned sorted set are also referenced by the invoking sorted set.

 

Object last ():

This returns the last element in the invoking sorted set.

A sorted set subset (object start, object end):

This returns a sorted set that includes those elements between the start and ends -1.

Elements in the returned collection are also referenced by the invoking object.

 

Sorted Set Tail Set (object start):

Returns a sorted set that contains those elements greater than or equal to the start that is contained in the sorted set. Elements in the returned set are also referenced by the invoking object.

 

int size() :

Returns the number of elements in this collection

 

Set Interface Homework Help