2:23 am - Tuesday March 28, 2017

Tag Archives: java code

Calendar in java example program get(int field)

/** *@author: candidjava *@description: Collections in JAVA example program for get(int field) **/ import java.util.Calendar; public class CalendarDemo { public static void main(String[] args) throws Exception { // create...

Calendar Example Programs

Calendar in java example program add(int field, int amount) _____________________________________________________________________________________________________________________ Calendar in java example program clear() _____________________________________________________________________________________________________________________ Calendar...

Calendar in java example program add(int field, int amount)

/** *@author:candidjava *@description:Calendar in java example program add(int field, int amount) **/ import java.util.Calendar; public class CalendarAdd { public static void main(String[] args) { // create a calendar Calendar...

Currency in java example program for getSymbol()

/** *@author: candidjava *@description: Currency in JAVA example program for getSymbol() **/ import java.util.Currency; public class Getsymbol { public static void main(String[] args) { // create a currency for euro Currency curr...

Hashtable Example program for putAll(Map t)

// Hashtable Example program for putAll(Map t) /** @author: candidjava.com @description: This method is used to copy all of the mapping elements to the specified  Hashtable. */ import java.util.*; class Case { public static void main(String[]...

Hashtable Example program for containsKey(Object key)

/** *@author:kingsley *@description:Hashtable Example program for ContainsKey */ import java.util.Hashtable; class HashTableExam { public static void main ( String[] args ) { Hashtable ht=new Hashtable(); // creating...

Hashtable Example program for clone()

// Hashtable Example program for clone() /** @author: candidjava.com @description: This program gives the copy of the existing Hashtable. */ import java.util.*; public class Clone { public static void main(String[] args) { Hashtable...

LinkedList Example Program for toArray(T[] a)

//program name: LinkedList Example Program for toArray(T[] a) /** @ author:candidjava.com @description: Returns an array containing all of the elements in this list in proper sequence (from first to last element); the runtime type of...

LinkedList Example Program for toArray()

/** *LinkedList Example Program for toArray() * @author   candidjava.com * @description:  Returns an array containing all of the elements in this list in proper sequence (from first to last element). */ import java.util.*; public...

LinkedList Example Program for size()

/** *LinkedList Example Program for size() * @author   candidjava.com * @description:  Returns the total number of elements present in this list. */ import java.util.*; class Linkedlist { public static void main(String[] args)...

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