3:13 pm - Friday December 17, 5971

Author Archives: Mathan Lal

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 remove Last Occurrence(Object o)

//LinkedList Example Program for removeLastOccurrence(Object o) /** * @author   candidjava.com * @description: Removes the last occurrence of the specified element in this list (when traversing the list from head to tail).If the list...

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 removeFirstOccurrence(Object o)

/** *LinkedList Example Program for removeFirstOccurrence(Object o) * @author   candidjava.com * @description:Removes the first occurrence of the specified element in this list(when traversing the list from head to tail) If the list...

LinkedList Example Program for removeFirst()

/** *LinkedList Example Program for removeFirst() * @author   candidjava.com * @description:  Removes first element of the linkedlist . */ import java.util.LinkedList; public class List { public static void main(String args[])...

LinkedList Example Program for remove(Object o)

//LinkedList Example Program for remove(Object o) /** * @author   candidjava.com * @description: //this method removes the first occurrence of the specified  element from this list. */ import java.util.LinkedList; public class...

LinkedList Example Program for remove(int index)

//LinkedList Example Program for remove(int index) /** * @author   candidjava.com * @description:Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices). Returns...

LinkedList Example Program for remove()

/** *@author:candidjava *@description:LinkedList Example Program for remove() **/ import java.util.LinkedList; public class Remove { public static void main(String[] args) { // create a LinkedList LinkedList list = new LinkedList(); ...

LinkedList Example Program for push(E e)

/** *@author: candidjava *@description: LinkedList Example Program for push(E e) */ import java.util.LinkedList; public class Push { public static void main(String[] args) { // create a LinkedList LinkedList list = new LinkedList(); //...

LinkedList Example Program for pop()

/** *@Author:candidJava.com *@Description:Remove top object of stack and return the object using pop() and class Pop */ import java.util.*; public class LinkedListPop { public static void main(String args[]) { LinkedList<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 poll()

/*Remove and retrieve the head of the list using poll() and class Poll*/ /** *@Author: candidjava.com *@Description: Remove and retrieve the head of the list using poll() and class Poll */ import java.util.*; public class LinkedListPoll...

LinkedList Example Program for peek()

/** *@Author:candid *@Definition:find head of the list using peek() *@class:Peek */ import java.util.*; public class Peek { public static void main(String args[]) { LinkedList<String> ls = new LinkedList<String>();//...

LinkedList Example Program for element()

//LinkedList Example Program for element() /** * @author   candidjava.com * @description:Retrieves, but does not remove, the head (first element) of this list. */ import java.util.*; public class List { public static void...

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(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 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...

Vector Example Program for toString()

@author:candidjava.com @description:Vector Example Program for toString() */ import java.util.Vector; public class ToString { public static void main(String args[]) { Vector<Integer>vc=new Vector<Integer>(); vc.add(11); vc.add(22); vc.add(33); vc.add(44); System.out.println(vc); //convert...

Vector Example Program for toArray(T[] a)

/*Program Name: Vector Example Program for toArray(T[] a)*/ /** *@Author: Candidjava.com *@Description:Vector Example Program for toArray(T[] a) Method is used to Returns an array containing all of the elements in this Vector in the...

Vector Example Program for toArray()

/***vector ex0ample program for toArray()***/ /** *@Author:CandidJava.com *@Description:convert vector collection to Array */ import java.util.Vector; public class VectorToArray { public static void main(String args[]) { Vector...