SlideShare a Scribd company logo
Java.util package contains the collections
framework, legacy collection classes,
event model, date and time facilities,
internationalization, and miscellaneous
utility classes.
Java.util Package
ArrayDeque
 1. ArrayDeque implements Deque interface and
ArrayDeque are available from jdk1.6.
2. Deque is that queue which allows insert and
remove of elements from both sides.
3. ArrayDeque is not thread safe. ArrayDeque
allows unlimited insertion of elements.
Constructor & Description
 ArrayDeque()
 This constructor is used to create an empty array
deque with an initial capacity sufficient to hold 16
elements.
 ArrayDeque(Collection<? extends E> c)
 This constructor is used to create a deque
containing the elements of the specified
collection.
 ArrayDeque(int numElements)
 This constructor is used to create an empty array
deque with an initial capacity sufficient to hold the
specified number of elements.
 boolean add(E e)
 This method inserts the specified element at the end of this
deque.
 void addFirst(E e)
 This method inserts the specified element at the front of
this deque.
 void addLast(E e)
 This method inserts the specified element at the end of this
deque.
 void clear()
 This method removes all of the elements from this deque.
 ArrayDeque<E> clone()
 This method returns a copy of this deque.
 boolean contains(Object o)
 This method returns true if this deque contains the
 The java.util.ArrayList class provides resizable-
array and implements theList interface.Following
are the important points about ArrayList:
 ArrayList class can contain duplicate elements.
 ArrayList class maintains insertion order.
 ArrayList class is non synchronized.
 ArrayList allows random access because array
works at the index basis.
 ArrayList class uses a dynamic array for storing
the elements.It extends AbstractList class and
implements List interface.
 The java.util.Arrays class contains a static
factory that allows arrays to be viewed as
lists.Following are the important points about
Arrays:
 This class contains various methods for
manipulating arrays (such as sorting and
searching).
 The methods in this class throw a
NullPointerException if the specified array
reference is null.
 public class Arrays extends Object
 The java.util.BitSet class implements a vector of bits
that grows as needed.Following are the important
points about BitSet:
 A BitSet is not safe for multithreaded use without
external synchronization.
 All bits in the set initially have the value false.
 Passing a null parameter to any of the methods in a
BitSet will result in a NullPointerException.
 BitSet()
 This constructor creates a new bit set.
 BitSet(int nbits)
 This constructor creates a bit set whose initial size is
large enough to explicitly represent bits with indices in
the range 0 through nbits-1.
 The java.util.calendar class is an abstract class that
provides methods for converting between a specific
instant in time and a set of calendar fields such as
YEAR, MONTH, DAY_OF_MONTH, HOUR, and so
on, and for manipulating the calendar fields, such as
getting the date of the next week.
 public abstract class Calendar extends Object
implements Serializable, Cloneable,
Comparable<Calendar>
 protected Calendar()
 This constructor constructs a Calendar with the
default time zone and locale.
 protected Calendar(TimeZone zone, Locale
aLocale)
 This constructor constructs a calendar with the
specified time zone and locale.
 The java.util.Dictionary class is the abstract parent of any class, such as Hashtable, which
maps keys to values.Following are the important points about Dictionary:
 java.util.Dictionary class every key and every value is an object.
 java.util.Dictionary object every key is associated with at most one value.
 public abstract class Dictionary<K,V> extends Object
 Dictionary()
 This is the single constructor.
 abstract Enumeration<V> elements()
 This method returns an enumeration of the values in this dictionary.
 abstract V get(Object key)
 This method returns the value to which the key is mapped in this dictionary.
 abstract boolean isEmpty()
 This method tests if this dictionary maps no keys to value.
 abstract Enumeration<K> keys()
 This method returns an enumeration of the keys in this dictionary.
 abstract int size()
 This method returns the number of entries (distinct keys) in this dictionary.
 etc…
 The java.util.EnumMap class is a specialized Map
implementation for use with enum keys.Following are the
important points about EnumMap:
 All of the keys in an enum map must come from a single enum
type that is specified, explicitly or implicitly, when the map is
created.
 Enum maps are maintained in the natural order of their keys.
 EnumMap is not synchronized.If multiple threads access an
enum map concurrently, and at least one of the threads modifies
the map, it should be synchronized externally.
 public class EnumMap<K extends Enum<K>,V> extends
AbstractMap<K,V> implements Serializable, Cloneable
 EnumMap(Class<K> keyType)
 This constructor creates an empty enum map with the specified
key type.
 EnumMap(EnumMap<K,? extends V> m)
 This constructor creates an enum map with the same key type
as the specified enum map, initially containing the same
mappings (if any).
HashMap in Java
 HashMap in Java with Example. HashMap maintains key
and value pairs and often denoted as HashMap<Key,
Value> or HashMap<K, V>.
 HashMap implements Map interface.
 HashMap is similar to Hashtable with two exceptions –
HashMap methods are unsynchornized and it allows null
key and null values unlike Hashtable
 A HashMap contains values based on the key. It
implements the Map interface and extends AbstractMap
class.
 It contains only unique elements.
 It may have one null key and multiple null values.
 It maintains no order.
 public class HashMap<K,V> extends AbstractMap<K,V>
implements Map<K,V>, Cloneable, Serializable
 uses hashtable to store the elements.It extends AbstractSet class and
implements Set interface.
 contains unique elements only.
 Difference between List and Set:
 List can contain duplicate elements whereas Set contains unique
elements only.
 public class HashSet<E> extends AbstractSet<E> implements Set<E>,
Cloneable, Serializable
 HashSet()
 This constructs a new, empty set; the backing HashMap instance has
default initial capacity (16) and load factor (0.75).
 HashSet(Collection<? extends E> c)
 This constructs a new set containing the elements in the specified
collection.
 boolean add(E e)
 This method adds the specified element to this set if it is not already
present.
 void clear()
 This method removes all of the elements from this set.
Java LinkedHashSet class
 Java LinkedHashSet class
 contains unique elements only like HashSet. It extends HashSet class
and implements Set interface.
 maintains insertion order.
 The java.util.LinkedHashSet class is a Hash table and Linked list
implementation of the Set interface, with predictable iteration
order.Following are the important points about LinkedHashSet:
 This class provides all of the optional Set operations, and permits null
elements.
 public class LinkedHashSet<E> extends HashSet<E> implements
Set<E>, Cloneable, Serializable
 LinkedHashSet()
 This constructs a new, empty linked hash set with the default initial
capacity (16) and load factor (0.75).
 LinkedHashSet(Collection<? extends E> c)
 This constructs a new linked hash set with the same elements as the
specified collection.
 This class inherits methods from the following classes:
java.util.Properties
 The java.util.Properties class is a class which represents a persistent
set of properties.The Properties can be saved to a stream or loaded
from a stream.Following are the important points about Properties:
 Each key and its corresponding value in the property list is a string.
 A property list can contain another property list as its 'defaults', this
second property list is searched if the property key is not found in the
original property list.
 This class is thread-safe; multiple threads can share a single Properties
object without the need for external synchronization.
 public class Properties extends Hashtable<Object,Object>
 Advantage of properties file
 Easy Maintenance: If any information is changed from the properties
file, you don't need to recompile the java class. It is mainly used to
contain variable information i.e. to be changed.
 String getProperty(String key)
 This method searches for the property with the specified key in this
property list.

More Related Content

What's hot

JavaFX Overview
JavaFX OverviewJavaFX Overview
JavaFX Overview
José Maria Silveira Neto
 
MULTI THREADING IN JAVA
MULTI THREADING IN JAVAMULTI THREADING IN JAVA
MULTI THREADING IN JAVA
VINOTH R
 
Java annotations
Java annotationsJava annotations
Java annotations
FAROOK Samath
 
Java program structure
Java program structureJava program structure
Java program structure
shalinikarunakaran1
 
java interface and packages
java interface and packagesjava interface and packages
java interface and packages
VINOTH R
 
Java &amp; advanced java
Java &amp; advanced javaJava &amp; advanced java
Java &amp; advanced java
BASAVARAJ HUNSHAL
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
Sandeep Rawat
 
Applets in java
Applets in javaApplets in java
Applets in java
Wani Zahoor
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
kamal kotecha
 
Java - Collections framework
Java - Collections frameworkJava - Collections framework
Java - Collections framework
Riccardo Cardin
 
Interface in java
Interface in javaInterface in java
Interface in java
PhD Research Scholar
 
Collections in Java Notes
Collections in Java NotesCollections in Java Notes
Collections in Java Notes
Shalabh Chaudhary
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
sunmitraeducation
 
Types of Drivers in JDBC
Types of Drivers in JDBCTypes of Drivers in JDBC
Types of Drivers in JDBC
Hemant Sharma
 
Generics in java
Generics in javaGenerics in java
Generics in java
suraj pandey
 
Introduction of java
Introduction  of javaIntroduction  of java
Introduction of java
Madishetty Prathibha
 
Elements of Java Language
Elements of Java Language Elements of Java Language
Elements of Java Language
Hitesh-Java
 
Introduction to java (revised)
Introduction to java (revised)Introduction to java (revised)
Introduction to java (revised)
Sujit Majety
 
Exception Handling in JAVA
Exception Handling in JAVAException Handling in JAVA
Exception Handling in JAVA
SURIT DATTA
 
Constructor in java
Constructor in javaConstructor in java
Constructor in java
Pavith Gunasekara
 

What's hot (20)

JavaFX Overview
JavaFX OverviewJavaFX Overview
JavaFX Overview
 
MULTI THREADING IN JAVA
MULTI THREADING IN JAVAMULTI THREADING IN JAVA
MULTI THREADING IN JAVA
 
Java annotations
Java annotationsJava annotations
Java annotations
 
Java program structure
Java program structureJava program structure
Java program structure
 
java interface and packages
java interface and packagesjava interface and packages
java interface and packages
 
Java &amp; advanced java
Java &amp; advanced javaJava &amp; advanced java
Java &amp; advanced java
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Applets in java
Applets in javaApplets in java
Applets in java
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
 
Java - Collections framework
Java - Collections frameworkJava - Collections framework
Java - Collections framework
 
Interface in java
Interface in javaInterface in java
Interface in java
 
Collections in Java Notes
Collections in Java NotesCollections in Java Notes
Collections in Java Notes
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
 
Types of Drivers in JDBC
Types of Drivers in JDBCTypes of Drivers in JDBC
Types of Drivers in JDBC
 
Generics in java
Generics in javaGenerics in java
Generics in java
 
Introduction of java
Introduction  of javaIntroduction  of java
Introduction of java
 
Elements of Java Language
Elements of Java Language Elements of Java Language
Elements of Java Language
 
Introduction to java (revised)
Introduction to java (revised)Introduction to java (revised)
Introduction to java (revised)
 
Exception Handling in JAVA
Exception Handling in JAVAException Handling in JAVA
Exception Handling in JAVA
 
Constructor in java
Constructor in javaConstructor in java
Constructor in java
 

Similar to Java.util

Java util
Java utilJava util
Java util
Srikrishna k
 
Java collections
Java collectionsJava collections
Java collections
Hamid Ghorbani
 
Array list (java platform se 8 )
Array list (java platform se 8 )Array list (java platform se 8 )
Array list (java platform se 8 )
charan kumar
 
Collections Api - Java
Collections Api - JavaCollections Api - Java
Collections Api - Java
Drishti Bhalla
 
Nature Activities Binder _ by Slidesgo.pptx
Nature Activities Binder _ by Slidesgo.pptxNature Activities Binder _ by Slidesgo.pptx
Nature Activities Binder _ by Slidesgo.pptx
IllllBikkySharmaIlll
 
11000121065_NAITIK CHATTERJEE.ppt
11000121065_NAITIK CHATTERJEE.ppt11000121065_NAITIK CHATTERJEE.ppt
11000121065_NAITIK CHATTERJEE.ppt
NaitikChatterjee
 
Collection framework (completenotes) zeeshan
Collection framework (completenotes) zeeshanCollection framework (completenotes) zeeshan
Collection framework (completenotes) zeeshan
Zeeshan Khan
 
Collection Framework in Java | Generics | Input-Output in Java | Serializatio...
Collection Framework in Java | Generics | Input-Output in Java | Serializatio...Collection Framework in Java | Generics | Input-Output in Java | Serializatio...
Collection Framework in Java | Generics | Input-Output in Java | Serializatio...
Sagar Verma
 
Java collections
Java collectionsJava collections
Java collectionspadmad2291
 
Generics collections
Generics collectionsGenerics collections
Generics collections
Yaswanth Babu Gummadivelli
 
collection framework.pptx
collection framework.pptxcollection framework.pptx
collection framework.pptx
SoniaKapoor56
 
Java Collections
Java  Collections Java  Collections
Collections framework
Collections frameworkCollections framework
Collections framework
Anand Buddarapu
 
Java Unit 2 (Part 2)
Java Unit 2 (Part 2)Java Unit 2 (Part 2)
Java Unit 2 (Part 2)
SURBHI SAROHA
 
Java Collections Tutorials
Java Collections TutorialsJava Collections Tutorials
Java Collections Tutorials
Prof. Erwin Globio
 

Similar to Java.util (20)

Java util
Java utilJava util
Java util
 
Java collections
Java collectionsJava collections
Java collections
 
Array list (java platform se 8 )
Array list (java platform se 8 )Array list (java platform se 8 )
Array list (java platform se 8 )
 
Advanced core java
Advanced core javaAdvanced core java
Advanced core java
 
20 ch22 collections
20 ch22 collections20 ch22 collections
20 ch22 collections
 
Collections Api - Java
Collections Api - JavaCollections Api - Java
Collections Api - Java
 
Nature Activities Binder _ by Slidesgo.pptx
Nature Activities Binder _ by Slidesgo.pptxNature Activities Binder _ by Slidesgo.pptx
Nature Activities Binder _ by Slidesgo.pptx
 
11000121065_NAITIK CHATTERJEE.ppt
11000121065_NAITIK CHATTERJEE.ppt11000121065_NAITIK CHATTERJEE.ppt
11000121065_NAITIK CHATTERJEE.ppt
 
Collection framework (completenotes) zeeshan
Collection framework (completenotes) zeeshanCollection framework (completenotes) zeeshan
Collection framework (completenotes) zeeshan
 
Collection Framework in Java | Generics | Input-Output in Java | Serializatio...
Collection Framework in Java | Generics | Input-Output in Java | Serializatio...Collection Framework in Java | Generics | Input-Output in Java | Serializatio...
Collection Framework in Java | Generics | Input-Output in Java | Serializatio...
 
Collections
CollectionsCollections
Collections
 
Java collections
Java collectionsJava collections
Java collections
 
Generics collections
Generics collectionsGenerics collections
Generics collections
 
Array properties
Array propertiesArray properties
Array properties
 
collection framework.pptx
collection framework.pptxcollection framework.pptx
collection framework.pptx
 
Java Collections
Java  Collections Java  Collections
Java Collections
 
Collections framework
Collections frameworkCollections framework
Collections framework
 
Java Unit 2 (Part 2)
Java Unit 2 (Part 2)Java Unit 2 (Part 2)
Java Unit 2 (Part 2)
 
Md08 collection api
Md08 collection apiMd08 collection api
Md08 collection api
 
Java Collections Tutorials
Java Collections TutorialsJava Collections Tutorials
Java Collections Tutorials
 

More from Ramakrishna kapa

Load balancer in mule
Load balancer in muleLoad balancer in mule
Load balancer in mule
Ramakrishna kapa
 
Anypoint connectors
Anypoint connectorsAnypoint connectors
Anypoint connectors
Ramakrishna kapa
 
Batch processing
Batch processingBatch processing
Batch processing
Ramakrishna kapa
 
Msmq connectivity
Msmq connectivityMsmq connectivity
Msmq connectivity
Ramakrishna kapa
 
Scopes in mule
Scopes in muleScopes in mule
Scopes in mule
Ramakrishna kapa
 
Data weave more operations
Data weave more operationsData weave more operations
Data weave more operations
Ramakrishna kapa
 
Basic math operations using dataweave
Basic math operations using dataweaveBasic math operations using dataweave
Basic math operations using dataweave
Ramakrishna kapa
 
Dataweave types operators
Dataweave types operatorsDataweave types operators
Dataweave types operators
Ramakrishna kapa
 
Operators in mule dataweave
Operators in mule dataweaveOperators in mule dataweave
Operators in mule dataweave
Ramakrishna kapa
 
Data weave in mule
Data weave in muleData weave in mule
Data weave in mule
Ramakrishna kapa
 
Servicenow connector
Servicenow connectorServicenow connector
Servicenow connector
Ramakrishna kapa
 
Introduction to testing mule
Introduction to testing muleIntroduction to testing mule
Introduction to testing mule
Ramakrishna kapa
 
Choice flow control
Choice flow controlChoice flow control
Choice flow control
Ramakrishna kapa
 
Message enricher example
Message enricher exampleMessage enricher example
Message enricher example
Ramakrishna kapa
 
Mule exception strategies
Mule exception strategiesMule exception strategies
Mule exception strategies
Ramakrishna kapa
 
Anypoint connector basics
Anypoint connector basicsAnypoint connector basics
Anypoint connector basics
Ramakrishna kapa
 
Mule global elements
Mule global elementsMule global elements
Mule global elements
Ramakrishna kapa
 
Mule message structure and varibles scopes
Mule message structure and varibles scopesMule message structure and varibles scopes
Mule message structure and varibles scopes
Ramakrishna kapa
 
How to create an api in mule
How to create an api in muleHow to create an api in mule
How to create an api in mule
Ramakrishna kapa
 
Log4j is a reliable, fast and flexible
Log4j is a reliable, fast and flexibleLog4j is a reliable, fast and flexible
Log4j is a reliable, fast and flexible
Ramakrishna kapa
 

More from Ramakrishna kapa (20)

Load balancer in mule
Load balancer in muleLoad balancer in mule
Load balancer in mule
 
Anypoint connectors
Anypoint connectorsAnypoint connectors
Anypoint connectors
 
Batch processing
Batch processingBatch processing
Batch processing
 
Msmq connectivity
Msmq connectivityMsmq connectivity
Msmq connectivity
 
Scopes in mule
Scopes in muleScopes in mule
Scopes in mule
 
Data weave more operations
Data weave more operationsData weave more operations
Data weave more operations
 
Basic math operations using dataweave
Basic math operations using dataweaveBasic math operations using dataweave
Basic math operations using dataweave
 
Dataweave types operators
Dataweave types operatorsDataweave types operators
Dataweave types operators
 
Operators in mule dataweave
Operators in mule dataweaveOperators in mule dataweave
Operators in mule dataweave
 
Data weave in mule
Data weave in muleData weave in mule
Data weave in mule
 
Servicenow connector
Servicenow connectorServicenow connector
Servicenow connector
 
Introduction to testing mule
Introduction to testing muleIntroduction to testing mule
Introduction to testing mule
 
Choice flow control
Choice flow controlChoice flow control
Choice flow control
 
Message enricher example
Message enricher exampleMessage enricher example
Message enricher example
 
Mule exception strategies
Mule exception strategiesMule exception strategies
Mule exception strategies
 
Anypoint connector basics
Anypoint connector basicsAnypoint connector basics
Anypoint connector basics
 
Mule global elements
Mule global elementsMule global elements
Mule global elements
 
Mule message structure and varibles scopes
Mule message structure and varibles scopesMule message structure and varibles scopes
Mule message structure and varibles scopes
 
How to create an api in mule
How to create an api in muleHow to create an api in mule
How to create an api in mule
 
Log4j is a reliable, fast and flexible
Log4j is a reliable, fast and flexibleLog4j is a reliable, fast and flexible
Log4j is a reliable, fast and flexible
 

Recently uploaded

Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
Peter Caitens
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
NaapbooksPrivateLimi
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Hivelance Technology
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
MayankTawar1
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
XfilesPro
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
ayushiqss
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 

Recently uploaded (20)

Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 

Java.util

  • 1. Java.util package contains the collections framework, legacy collection classes, event model, date and time facilities, internationalization, and miscellaneous utility classes. Java.util Package
  • 2. ArrayDeque  1. ArrayDeque implements Deque interface and ArrayDeque are available from jdk1.6. 2. Deque is that queue which allows insert and remove of elements from both sides. 3. ArrayDeque is not thread safe. ArrayDeque allows unlimited insertion of elements.
  • 3. Constructor & Description  ArrayDeque()  This constructor is used to create an empty array deque with an initial capacity sufficient to hold 16 elements.  ArrayDeque(Collection<? extends E> c)  This constructor is used to create a deque containing the elements of the specified collection.  ArrayDeque(int numElements)  This constructor is used to create an empty array deque with an initial capacity sufficient to hold the specified number of elements.
  • 4.  boolean add(E e)  This method inserts the specified element at the end of this deque.  void addFirst(E e)  This method inserts the specified element at the front of this deque.  void addLast(E e)  This method inserts the specified element at the end of this deque.  void clear()  This method removes all of the elements from this deque.  ArrayDeque<E> clone()  This method returns a copy of this deque.  boolean contains(Object o)  This method returns true if this deque contains the
  • 5.  The java.util.ArrayList class provides resizable- array and implements theList interface.Following are the important points about ArrayList:  ArrayList class can contain duplicate elements.  ArrayList class maintains insertion order.  ArrayList class is non synchronized.  ArrayList allows random access because array works at the index basis.  ArrayList class uses a dynamic array for storing the elements.It extends AbstractList class and implements List interface.
  • 6.  The java.util.Arrays class contains a static factory that allows arrays to be viewed as lists.Following are the important points about Arrays:  This class contains various methods for manipulating arrays (such as sorting and searching).  The methods in this class throw a NullPointerException if the specified array reference is null.  public class Arrays extends Object
  • 7.  The java.util.BitSet class implements a vector of bits that grows as needed.Following are the important points about BitSet:  A BitSet is not safe for multithreaded use without external synchronization.  All bits in the set initially have the value false.  Passing a null parameter to any of the methods in a BitSet will result in a NullPointerException.  BitSet()  This constructor creates a new bit set.  BitSet(int nbits)  This constructor creates a bit set whose initial size is large enough to explicitly represent bits with indices in the range 0 through nbits-1.
  • 8.  The java.util.calendar class is an abstract class that provides methods for converting between a specific instant in time and a set of calendar fields such as YEAR, MONTH, DAY_OF_MONTH, HOUR, and so on, and for manipulating the calendar fields, such as getting the date of the next week.  public abstract class Calendar extends Object implements Serializable, Cloneable, Comparable<Calendar>  protected Calendar()  This constructor constructs a Calendar with the default time zone and locale.  protected Calendar(TimeZone zone, Locale aLocale)  This constructor constructs a calendar with the specified time zone and locale.
  • 9.  The java.util.Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to values.Following are the important points about Dictionary:  java.util.Dictionary class every key and every value is an object.  java.util.Dictionary object every key is associated with at most one value.  public abstract class Dictionary<K,V> extends Object  Dictionary()  This is the single constructor.  abstract Enumeration<V> elements()  This method returns an enumeration of the values in this dictionary.  abstract V get(Object key)  This method returns the value to which the key is mapped in this dictionary.  abstract boolean isEmpty()  This method tests if this dictionary maps no keys to value.  abstract Enumeration<K> keys()  This method returns an enumeration of the keys in this dictionary.  abstract int size()  This method returns the number of entries (distinct keys) in this dictionary.  etc…
  • 10.  The java.util.EnumMap class is a specialized Map implementation for use with enum keys.Following are the important points about EnumMap:  All of the keys in an enum map must come from a single enum type that is specified, explicitly or implicitly, when the map is created.  Enum maps are maintained in the natural order of their keys.  EnumMap is not synchronized.If multiple threads access an enum map concurrently, and at least one of the threads modifies the map, it should be synchronized externally.  public class EnumMap<K extends Enum<K>,V> extends AbstractMap<K,V> implements Serializable, Cloneable  EnumMap(Class<K> keyType)  This constructor creates an empty enum map with the specified key type.  EnumMap(EnumMap<K,? extends V> m)  This constructor creates an enum map with the same key type as the specified enum map, initially containing the same mappings (if any).
  • 11. HashMap in Java  HashMap in Java with Example. HashMap maintains key and value pairs and often denoted as HashMap<Key, Value> or HashMap<K, V>.  HashMap implements Map interface.  HashMap is similar to Hashtable with two exceptions – HashMap methods are unsynchornized and it allows null key and null values unlike Hashtable  A HashMap contains values based on the key. It implements the Map interface and extends AbstractMap class.  It contains only unique elements.  It may have one null key and multiple null values.  It maintains no order.  public class HashMap<K,V> extends AbstractMap<K,V> implements Map<K,V>, Cloneable, Serializable
  • 12.  uses hashtable to store the elements.It extends AbstractSet class and implements Set interface.  contains unique elements only.  Difference between List and Set:  List can contain duplicate elements whereas Set contains unique elements only.  public class HashSet<E> extends AbstractSet<E> implements Set<E>, Cloneable, Serializable  HashSet()  This constructs a new, empty set; the backing HashMap instance has default initial capacity (16) and load factor (0.75).  HashSet(Collection<? extends E> c)  This constructs a new set containing the elements in the specified collection.  boolean add(E e)  This method adds the specified element to this set if it is not already present.  void clear()  This method removes all of the elements from this set.
  • 13. Java LinkedHashSet class  Java LinkedHashSet class  contains unique elements only like HashSet. It extends HashSet class and implements Set interface.  maintains insertion order.  The java.util.LinkedHashSet class is a Hash table and Linked list implementation of the Set interface, with predictable iteration order.Following are the important points about LinkedHashSet:  This class provides all of the optional Set operations, and permits null elements.  public class LinkedHashSet<E> extends HashSet<E> implements Set<E>, Cloneable, Serializable  LinkedHashSet()  This constructs a new, empty linked hash set with the default initial capacity (16) and load factor (0.75).  LinkedHashSet(Collection<? extends E> c)  This constructs a new linked hash set with the same elements as the specified collection.  This class inherits methods from the following classes:
  • 14. java.util.Properties  The java.util.Properties class is a class which represents a persistent set of properties.The Properties can be saved to a stream or loaded from a stream.Following are the important points about Properties:  Each key and its corresponding value in the property list is a string.  A property list can contain another property list as its 'defaults', this second property list is searched if the property key is not found in the original property list.  This class is thread-safe; multiple threads can share a single Properties object without the need for external synchronization.  public class Properties extends Hashtable<Object,Object>  Advantage of properties file  Easy Maintenance: If any information is changed from the properties file, you don't need to recompile the java class. It is mainly used to contain variable information i.e. to be changed.  String getProperty(String key)  This method searches for the property with the specified key in this property list.