1:39 am - Friday June 23, 2017

Tag Archives: LinkedList

LinkedList Example Program for set(int index, E element)

//LinkedList Example Program for set(int index, E element) /** * @author   candidjava.com * @description: Replaces the element at the specified position in this list with the specified            element. */ import...

LinkedList Example Program for removeLast()

//LinkedList Example Program for removeLast() /** * @author   candidjava.com * @description: //Removes and returns the last element from this list. */ import java.util.LinkedList; public class List1 { public static void main(String...

LinkedList Example Program for pollFirst()

/** *@author: candidjava.com *@description: coding  for linked list poll method */ import java.util.LinkedList; public class LinkedListDemo { public static void main(String[] args) { // create a LinkedList LinkedList list =...

LinkedList Example Program for clone()

/** *LinkedList Example Program for clone() * @author   candidjava.com * @description: Returns a shallow copy of this LinkedList. */ import java.util.*; public class Clone { public static void main(String args[]) { LinkedList...

LinkedList Example Program for addAll(int index, Collection c)

/*Program Name: LinkedList Example Program for addAll using int index, Collection c*/ /** *@Author: Candidjava.com *@Description:LinkedList Example Program for addAll (int index, Collection c) Program is used to Inserts all of the elements...

LinkedList Example Program for offerLast(E e)

//LinkedList Example Program for offerLast(E e) /** Author :candidjava.com Description: Inserts the specified element at the front of this list.. */ import java.io.IOException; import java.util.*; public class LinkedListOfferLast...

LinkedList Example Program for offerFirst(E e)

//LinkedList Example Program for offerFirst(E e) /** Author :candidjava.com Description: Inserts the specified element at the front of this list.. */ import java.io.IOException; import java.util.*; public class DeeLinkedListOfferFirst...

LinkedList Example Program for listIterator(int index)

/** Author :candidjava.com Description: Returns a list-iterator of the elements in this list (in proper sequence), starting at the specified position in the list. */ import java.io.IOException; import java.util.*; public class LinkedListListIterator...

LinkedList Example Program for lastIndexOf(Object o)

/** Author :candidjava.com Description: Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element. */ import java.io.IOException; import java.util.*; public class...

LinkedList Example Program for indexOf(Object o)

/** Author :candidjava.com Description: Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. */ import java.io.IOException; import java.util.*; public class...

LinkedList Example Program for getFirst()

/** Author :candidjava.com Description: Returns the first element in the list. */ import java.io.IOException; import java.util.*; public class LinkedListGetFirst { public static void main(String args[]) { int b=60,c=20,d=30; LinkedList...

LinkedList Example Program for get(int index)

/** Author :candidjava.com Description: Returns the element at the specified position in this list. */ import java.io.IOException; import java.util.*; public class LinkedListGetExample { public static void main(String args[]) { int...

LinkedList Example Program for descendingIterator()

/** Author :candidjava.com Description: It Returns an iterator over the elements in this deque in reverse sequential order. The elements will be returned in order from last (tail) to first (head). */ import java.io.IOException; import...

LinkedList Example Program for contains(Object o)

/** Author :candidjava.com Description: It will return the hashcode value of the object which we creates. */ import java.io.IOException; import java.util.*; public class LinkedListContainExample { public static void main(String...

LinkedList Example Program for clear()

/** Author :candidjava.com Description: To calculate the current capacity of the string by using capacity() method it returns the current capacity of the String */ import java.io.IOException; import java.util.*; import java.io.IOException; public...

LinkedList Example Program for addLast(E e)

/** Author :candidjava.com Description: Appends the specified element to the end of this list. */ import java.io.IOException; import java.util.*; import java.io.IOException; public class LinkedlistAddLast { public static void main(String...

LinkedList Example Program for addFirst(E e)

/** Author :candidjava.com Description: To Inserts the specified element at the beginning of this list. */ import java.io.IOException; import java.util.*; import java.io.IOException; public class LinkedListAddFirst { public static...

LinkedList Example Program for add(int index, E element)

/** Author :candidjava.com Description: Inserts the specified element at the specified position in this list. */ import java.io.IOException; import java.util.*; import java.io.IOException; public class LinkedlistAddExample2 { public...

LinkedList Example Program for add(E e)

/** @Author :candidjava.com @Description: To appends the specified element to the end of this list. */ import java.io.IOException; import java.util.*; public class LinkedlistAddExample { public static void main(String args[]) { boolean...

LinkedList example program to Get SubList using sublist()

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of SubList () method */ import java.util.LinkedList; import java.util.List; class GetSubListLinkedList { public static void main(String[] args)...