11:00 pm - Friday March 22, 2019

Archive: Java Examples Subscribe to Java Examples

Collections example programs | Java Collections tutorials

 Java Collection tutorials: AddAll() For Insert a collection element in already excisting collection LifoQueue() For View of Deque in Last-in-first-out order binarySearch(List<? extends T>,T,Comparator<?super T> For  Search a particular...

StringBuffer example programs and Tutorial in java

  Append two String using StringBuffer append() Method. Insert the String or word in a StringBuffer at the Specified Position. Replace the String or Word in a String Buffer at the Specified Position. Reverse  the String or Word in a String...

How to Add Multiple Objects to an Arraylist

BACK  Following method is used to add All object to ArrayList from other Collection Objects. Example Program import java.util.ArrayList; public class Fun { public static void main(String[] args) { ArrayList Student=new ArrayList(); Student.add("name:"); Student.add("age:"); Student.add("email:"); System.out.println("Enter...

How To Call the Hashtable method put using Properties.setProperty(String key, String value) method

BACK This tutorial explains how to Load a property list from the input character stream using Properties.load(Reader reader) method.Properties setProperty(String key, String value) calls the Hashtable method put. import java.util.Properties; public...

Java Example and Programs

Java Example and Programs lang package (java.lang.*) String          StringBuffer       StringBuilder         Integer          Float           Double          Long          Byte      Character     Boolean ...

PriorityQueue example program to order the elements in this queue, or null if this queue is sorted according to the natural ordering of its elements use Comparator() method.

BACK This Program is used to order the elements in this queue or null if this queue is sorted according to the natural ordering of its elements  using Comparator() method. Example Program package com.example; package com.example; import...

PriorityQueue example program to Remove a number/String from list

BACK This Program is used to Remove a number/String from list using remove() method. Example Program import java.util.PriorityQueue; public class PriorityQ { public static void main(String[] args) { PriorityQueue PQ = new PriorityQueue(); PQ.add(100); PQ.add(12); PQ.add(56); PQ.add(89); PQ.add(103); System.out.println("The...

PriorityQueue program using poll() method

BACK This Program is used PriorityQueue using poll() method. Example Program import java.util.PriorityQueue; public class PriorityQ { public static void main(String[] args) { PriorityQueue PQ = new PriorityQueue (); PQ.add(100); PQ.add(12); PQ.add(56); PQ.add(89); PQ.add(103); System.out.println("The...

PriorityQueue example program to add a range of numbers using Add() method

BACK   This Program is used PriorityQueue to add a range of numbers using Add() method. Example Program import java.util.PriorityQueue; public class PriorityQ { public static void main(String[] args) { PriorityQueue PQ = new...

PriorityQueue example programs and Tutorial in java

BACK   1.PriorityQueue example program to add a range of numbers using Add() method. 2.PriorityQueue program using poll() method 3.PriorityQueue example program to Remove a number/String from list using remove()   method. 4.PriorityQueue...

EnumMap returns a Collection view of the values contained in this map using Values() method

BACK This Program used EnumMap returns a Collection view of the contained in this map using Values() method Example Program package com.example; import java.util.*; public class EnumMapDemo { // create an enum public enum Numbers...

EnumMap Set View Contained on the map using EntrySet() method

BACK This Program is used  EnumMap Set View  Contained on the map using  EntrySet() method Example Program package com.example; import java.util.EnumMap; public class EnumMapContainsKey { // create an enum public enum Numbers { ONE,...

EnumMap for Mapping in Specfic Key using ContainsKey() method

BACK This Program is used EnumMap for Mapping in Specific Key using  ConstraintsKey() method Example Program package com.example; import java.util.EnumMap; public class EnumMapContainsKey { // create an enum public enum Numbers { ONE,...

EnumMap to find Elements are Equals using Equals() method

BACK This program is used to find the elements are equals using equals() method. Example Program package com.example; import java.util.*; public class EnumMapEquals { // create an enum public enum Numbers { ONE, TWO, THREE, FOUR,...

EnumMap example programs and Tutorial in java

BACK   1.EnumMap String and Number in Same  using PutAll() method 2.EnumMap  to find Elements are Equals by using Equals() method 3.EnumMap   for Mapping in Specfic Key using ContainsKey() method 4.EnumMap  Set View Contained on...

LinkedList to Remove last element on output RemoveLast() method

BACK This  method  used to remove last element from the LinkedList. Example Program package com.example; import java.util.*; public class LinkedListRemoveLast { public static void main(String[] args) { // create a LinkedList LinkedList...

LinkedList to add element on output Offer() method

BACK This Program is used to add element using Offer() method. Example Program package com.example; package com.example; import java.util.*; public class LinkedListOffer { public static void main(String[] args) { // create a...

LinkedList to Print First element on the Output using Peek() method

BACK This Program is used to print First element using Peek() method. Example Program package com.example; import java.util.*; public class LinkedListPeek { public static void main(String[] args) { // create a LinkedList LinkedList...

LinkedList to add element on output using Push() method

BACK This Program is used to add element on output using Push() method. Example Program   package com.example; import java.util.*; public class LinkedListPush { public static void main(String[] args) { // create a LinkedList LinkedList...

LinkedList remove head elements to output using Poll() method

BACK This Program is used to remove head elements from LinkedList by using Poll() method. Example Program package com.example; package com.example; import java.util.*; public class LinkedListPoll { public static void main(String[]...