In this core java training session, you will learn Collections – Lists, Sets. Topics covered in this session are:
• List – ArrayList, LinkedList
• Set – HashSet, LinkedHashSet, TreeSet
For more information about this course visit on this link: https://www.mindsmapped.com/courses/software-development/learn-java-fundamentals-hands-on-training-on-core-java-concepts/
This presentation introduces some concepts about the Java Collection framework. These slides introduce the following concepts:
- Collections and iterators
- Linked list and array list
- Hash set and tree set
- Maps
- The collection framework
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
In this core java training session, you will learn Collections – Lists, Sets. Topics covered in this session are:
• List – ArrayList, LinkedList
• Set – HashSet, LinkedHashSet, TreeSet
For more information about this course visit on this link: https://www.mindsmapped.com/courses/software-development/learn-java-fundamentals-hands-on-training-on-core-java-concepts/
This presentation introduces some concepts about the Java Collection framework. These slides introduce the following concepts:
- Collections and iterators
- Linked list and array list
- Hash set and tree set
- Maps
- The collection framework
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
Java Collections | Collections Framework in Java | Java Tutorial For Beginner...Edureka!
**** Java Certification Training: https://www.edureka.co/java-j2ee-soa-training ****
This Edureka tutorial on “Java Collections” will talk about the complete hierarchy of Collections Frameworks in Java. It will walk you through the various fundamentals of collections like Lists, Queue, Sets, Interfaces etc. Through this tutorial you will learn the following topics:
Java Collection Framework
Collection Framework Hierarchy
Interfaces
List
Queue
Set
Check out our Java Tutorial blog series: https://goo.gl/osrGrS
Check out our complete Youtube playlist here: https://goo.gl/gMFLx3
https://youtu.be/_yLt_abcK2w
Angular is a TypeScript-based open-source front-end platform that makes it easy to build applications with in web/mobile/desktop. The major features of this framework such as declarative templates, dependency injection, end to end tooling, and many more other features are used to ease the development.
Angular 7 is a Javascript framework built around the concept of components, and more precisely, with the Web Components standard in mind. It was rewritten from scratch by the Angular team using Typescript (although we can use it with ES5, ES6, or Dart as well).
Angular 7 is a big change for us compared to 1.x. Because it is a completely different framework than 1.x, and is not backward-compatible. Angular 7 is written entirely in Typescript and meets the ECMAScript 6 specification
angular interview questions and answers, angular 7 interview questions and answers, angular interview question, angular interview questions and answers for experienced, angular 7 interview questions, angular 6 interview questions,
angular interview questions, angular 6 interview questions and answers, angular 2 interview questions, angular7, angular 5 interview questions, angular interview, angular 2 interview questions and answers, angular questions and answers
Java 8 is coming soon. In this presentation I have outlined the major Java 8 features. You get information about interface improvements, functional interfaces, method references, lambdas, java.util.function, java.util.stream
Java Collections | Collections Framework in Java | Java Tutorial For Beginner...Edureka!
**** Java Certification Training: https://www.edureka.co/java-j2ee-soa-training ****
This Edureka tutorial on “Java Collections” will talk about the complete hierarchy of Collections Frameworks in Java. It will walk you through the various fundamentals of collections like Lists, Queue, Sets, Interfaces etc. Through this tutorial you will learn the following topics:
Java Collection Framework
Collection Framework Hierarchy
Interfaces
List
Queue
Set
Check out our Java Tutorial blog series: https://goo.gl/osrGrS
Check out our complete Youtube playlist here: https://goo.gl/gMFLx3
https://youtu.be/_yLt_abcK2w
Angular is a TypeScript-based open-source front-end platform that makes it easy to build applications with in web/mobile/desktop. The major features of this framework such as declarative templates, dependency injection, end to end tooling, and many more other features are used to ease the development.
Angular 7 is a Javascript framework built around the concept of components, and more precisely, with the Web Components standard in mind. It was rewritten from scratch by the Angular team using Typescript (although we can use it with ES5, ES6, or Dart as well).
Angular 7 is a big change for us compared to 1.x. Because it is a completely different framework than 1.x, and is not backward-compatible. Angular 7 is written entirely in Typescript and meets the ECMAScript 6 specification
angular interview questions and answers, angular 7 interview questions and answers, angular interview question, angular interview questions and answers for experienced, angular 7 interview questions, angular 6 interview questions,
angular interview questions, angular 6 interview questions and answers, angular 2 interview questions, angular7, angular 5 interview questions, angular interview, angular 2 interview questions and answers, angular questions and answers
Java 8 is coming soon. In this presentation I have outlined the major Java 8 features. You get information about interface improvements, functional interfaces, method references, lambdas, java.util.function, java.util.stream
12. 1. List Interface
12
Generate result តាម insertion order.
វា Support duplicacy
វា Support indexing មានន័យថាយយើងអាច insert element តាម index ជាក់លាក់បាន។
វាអាច synchronized និងមិន synchronized បានទាំងពីរ.
13. 1. List Interface
A List cares about the index.
“Paul” “Mark” “John” “Paul” “Luke”value
index 0 1 2 3 4
LinkedListVectorArrayList
20. 1. Arraylist
20
Two ways to iterate the elements of collection in java
• By Iterator interface.
• By for-each loop.
import java.util.*;
class TestCollection1{
public static void main(String args[]){
ArrayList<String> al=new ArrayList<String>();//creating arraylist
al.add("Ravi");//adding object in arraylist
al.add("Vijay");
al.add("Ravi");
al.add("Ajay");
Iterator itr=al.iterator();//getting Iterator from arraylist to traverse eleme
nts
while(itr.hasNext()){
System.out.println(itr.next());
}
}
}
22. 1. 2 Vector VS Arraylist
22
ArrayList Vector
1) ArrayList is not synchronized. Vector is synchronized.
2) ArrayList increments 50% of current array size if number of
element exceeds from its capacity.
Vector increments 100% means doubles the array size if total
number of element exceeds than its capacity.
3) ArrayList is not a legacy class, it is introduced in JDK 1.2. Vector is a legacy class.
4) ArrayList is fast because it is non-synchronized. Vector is slow because it is synchronized i.e. in multithreading
environment, it will hold the other threads in runnable or non-
runnable state until current thread releases the lock of object.
5) ArrayList uses Iterator interface to traverse the elements. Vector uses Enumeration interface to traverse the elements. But
it can use Iterator also.
23. 1. 3 Linked List
23
• វាត្រូវបានយត្រើតាាំងពីJava version 1.2មក។
• យត្រើលកខណDoubly linkedlist យដើមបី store element។
• អាចផ្ទុក Duplicate element(ធារុសទូន)។
• Maintaininsertion order (តាមលាំោរ់លាំយោយ)។
• Non synchronized។
• អាចយត្រើជាList លកខណ stackqueue។
24. 24
import java.util.*;
public class TestCollection7{
public static void main(String args[]){
LinkedList<String> al=new LinkedList<String>()
;
al.add("Ravi");
al.add("Vijay");
al.add("Ravi");
al.add("Ajay");
Iterator<String> itr=al.iterator();
while(itr.hasNext()){
System.out.println(itr.next());
}
}
}
Ravi
Vijay
Ravi
Ajay
25. 1. 4 Linked List VS ArrayList
25
ArrayList LinkedList
1) ArrayList internally uses dynamic array to store the
elements.
LinkedList internally uses doubly linked list to store the
elements.
2) Manipulation with ArrayList is slow because it internally uses
array. If any element is removed from the array, all the bits are
shifted in memory.
Manipulation with LinkedList is faster than ArrayList because it
uses doubly linked list so no bit shifting is required in memory.
3) ArrayList class can act as a list only because it implements
List only.
LinkedList class can act as a list and queue both because it
implements List and Deque interfaces.
4) ArrayList is better for storing and accessing data. LinkedList is better for manipulating data.
26. 2. Set Interface
26
វាមានតាាំងពី Java 1.2
វាមិនអនុញ្ញា រយអាយមាន Dupplicate យេ រុន្នែយរើយយើងយអាយមានរនមៃ Dupplicate ក៏វាមិនមាន Error យកើរយ ើងន្ដរ
វាមិន support indexing យេ។ មានន័យថា វាមិនមានការ insert និង delete elements តាម index ណាមួយយ ើយ។
30. 2.1 HashSet class
30
វាត្រូវបានយត្រើតាាំងពី Java Version 1.2 យមៃេះ។
វាមិន Support Dupplicate យេ។
It doesn't guarantee any order for generating result even it does not guarantee that the order will remain constant over
time.
វាអនុញ្ញា រយអាយមាន null ជា element។ មានន័យថាវាមិនមាន NullPointerException យកើរយ ើងយេយពលមាន element ជា Null
វាត្រូវការនូវ Hashtable class យដើមបី holding elements ររស់វា។
វាមិនមានលកខណៈជា synchronized យេន្រយយើងអាចយ្វើយអាយវា synchronized បានយៅតាមរត្មូវការ។
យត្រើនូវ hashtable យដើមបី store នូវ elements ររស់វា។
វា extends យចញពី AbstractSet class និង implements យចញពី Set interface.
ផ្ទុកន្រ unique elements ន្ររុយណាណ េះ។
31. HashSet class (continue)
31
import java.util.*;
class TestCollection9{
public static void main(String args[]){
HashSet<String> al=new HashSet<String>();
al.add("Ravi");
al.add("Vijay");
al.add("Ravi");
al.add("Ajay");
Iterator<String> itr=al.iterator();
while(itr.hasNext()){
System.out.println(itr.next());
}
}
}
Vijay
Ravi
Ajay
32. 2.2 TreeSet class
32
វាត្រូវបានយត្រើតាាំងពី Java version 1.2 មក។
វាមិន support នូវ duplicacy យេ។
វា generate នូវការ Order ននរនមៃជាលកខណៈ ascending ន្រយយើងក៏អាចយអាយវា generate តាម descending បានន្ដរ។
វាផ្ទុកន្រ unique elements ដូច HashSet ន្ដរ។
វា implements យចញពី NavigableSet interface ន្ដល extends ពី SortedSet interface.
33. 2.2 TreeSet class (ត)
33
import java.util.*;
class TestCollection11{
public static void main(String args[]){
TreeSet<String> al=new TreeSet<String>();
al.add("Ravi");
al.add("Vijay");
al.add("Ravi");
al.add("Ajay");
Iterator<String> itr=al.iterator();
while(itr.hasNext()){
System.out.println(itr.next());
}
}
}
Ajay
Ravi
Vijay
36. Map
A Map cares about unique identifiers.
“Paul” “Mark” “John” “Paul” “Luke”
key
value
“Pl” “Ma” “Jn” “ul” “Le”
LinkedHashMap TreeMapHashtableHashMap
37. Map World
Map
Hashtab
le
LinkedHashM
ap
Treemap
Like a slower HashMap (as
with Vector, due to its
synchronized methods). No
null values or null keys
allowed
Faster iterations;
iterates by insertion
order or last accessed;
allows one null key,
many null values
A sorted
map
HashMap
Fastest updates
(key/values);
allows one null
key, many
null values
38. 3. ស្វែ ងយល់អំពី TreeMap & HashTable
គឺជា class ស្ែល implements លរញពី NavigableMap interface និងវextends លរញពីវ
AbstractMap class
វាផ្ទ ុកនូវ value ល យស្ផ្អកលលើ key របវ់វា
វាមិនអារគ្នម ន keyលទ ស្តអារគ្នម ន Value បាន
វាផ្ទ ុកបានស្ត unique elements បលណាណ ោះ
វាតលស្មៀបជា ascending
3.1. TreeMap
39. 3. ស្វែ ងយល់អំពី TreeMap & HashTable
3.1.1 Constructor របវ់ TreeMap
TreeMap(): ជា constructor ស្ែលលស្បើលែើមបីបលងកើត empty tree map ស្ែលតលស្មៀបលកខណៈ
ascending តាម key value របវ់វា។
TreeMap(Comparator comp): លស្បើលែើមបីបលងកើត empty tree-based map ស្ែលតលស្មៀបតាម
Comparator comp។
TreeMap(Map m): constructor លនោះគឺ ផ្តល់តនមៃលៅលអាយ tree map ជាមួយនឹងធាត m
ស្ែលវានឹងតលស្មៀបលកខណៈ ascending តាម key value របវ់វា។
TreeMap(SortedMap sm): វាផ្តល់តនមៃលៅលអាយ tree map ជាមួយនឹងធាតពី SortedMap
sm ស្ែលវាតលស្មៀបែូរនឹង sm ស្ែរ។
40. 3. ស្វែ ងយល់អំពី TreeMap & HashTable
3.2 Methods របវ់ TreeMap
Method Desciption
void Clear() remove all mapping from this treemap
Object Clone() return a shallow copy របវ់វTreeMap instance
Comparator comparator() return comparator ស្ែលលស្បើលែើមបីតលស្មៀប
Boolean containsKey
(object key)
Return true លបើវtreemap លនោះមានផ្ទ ុកនូវ specified key
ស្ែលវmapping
Boolean
containsValue(object
Return true លបើ treemap លនោះ map លៅកាន់ keyមួយឬ
លស្រើនស្ែលមាន specified valueលនោះ
Set entrySet() Return a set view of the mapping contained in this
map.
A collection — sometimes called a container — is simply an object that groups multiple elements into a single unit. Collections are used to store, retrieve, manipulate, and communicate aggregate data. Typically, they represent data items that form a natural group, such as a poker hand (a collection of cards), a mail folder (a collection of letters), or a telephone directory (a mapping of names to phone numbers). If you have used the Java programming language — or just about any other programming language — you are already familiar with collections.
A collection — sometimes called a container — is simply an object that groups multiple elements into a single unit. Collections are used to store, retrieve, manipulate, and communicate aggregate data. Typically, they represent data items that form a natural group, such as a poker hand (a collection of cards), a mail folder (a collection of letters), or a telephone directory (a mapping of names to phone numbers). If you have used the Java programming language — or just about any other programming language — you are already familiar with collections.
A collection — sometimes called a container — is simply an object that groups multiple elements into a single unit. Collections are used to store, retrieve, manipulate, and communicate aggregate data. Typically, they represent data items that form a natural group, such as a poker hand (a collection of cards), a mail folder (a collection of letters), or a telephone directory (a mapping of names to phone numbers). If you have used the Java programming language — or just about any other programming language — you are already familiar with collections.
A collection — sometimes called a container — is simply an object that groups multiple elements into a single unit. Collections are used to store, retrieve, manipulate, and communicate aggregate data. Typically, they represent data items that form a natural group, such as a poker hand (a collection of cards), a mail folder (a collection of letters), or a telephone directory (a mapping of names to phone numbers). If you have used the Java programming language — or just about any other programming language — you are already familiar with collections.
A collection — sometimes called a container — is simply an object that groups multiple elements into a single unit. Collections are used to store, retrieve, manipulate, and communicate aggregate data. Typically, they represent data items that form a natural group, such as a poker hand (a collection of cards), a mail folder (a collection of letters), or a telephone directory (a mapping of names to phone numbers). If you have used the Java programming language — or just about any other programming language — you are already familiar with collections.
Java supplies several types of Collection:
Set: cannot contain duplicate elements, order is not important
SortedSet: like a Set, but order is important
List: may contain duplicate elements, order is important
Java also supplies some “collection-like” things:
Map: a “dictionary” that associates keys with values, order is not important
SortedMap: like a Map, but order is important
While you can get all the details from the Java API, you are expected to learn (i.e. memorize):
The signatures of the “most important” methods in each interface
The most important implementations of each interface
Java supplies several types of Collection:
Set: cannot contain duplicate elements, order is not important
SortedSet: like a Set, but order is important
List: may contain duplicate elements, order is important
Java also supplies some “collection-like” things:
Map: a “dictionary” that associates keys with values, order is not important
SortedMap: like a Map, but order is important
While you can get all the details from the Java API, you are expected to learn (i.e. memorize):
The signatures of the “most important” methods in each interface
The most important implementations of each interface