Skip to content

Infoginx Most Used Tags

3D 2017 AI Alexa Amazon Augmented Reality Big Data Bitcoin black holes Business Careers Cloud Computing Computer Programming Computing cryptocurrency Deep Learning Design Echo Facebook Finance Fintech Food Google Health History Innovation Instagram IoT Java Javascript Linux Machine Learning Marketing music Programming Python Science Startups Tech Technology travelling Uber Ubuntu UK Wordpress
Infoginx |

Let's be Creative

Primary Navigation Menu
Menu
  • Home
  • Technology
  • Lifestyle
  • Business
  • Science
  • Health
  • Viral
  • Login
  • Register

Multi-Threading

ListIterator vs Iterator in Java

ListIterator vs Iterator in Java

2018-12-03
By: Khawar Shehzad
On: December 3, 2018
In: Computing, Java, Programming, Technology
With: 0 Comments

An Iterator can iterate in only one direction (forward direction), whereas ListIterator can iterate in both forward and back directions. We can add or set a value at any time in the lifespan of the ListIterator. ListIterator maintains two pointers viz. previous and next. An Iterator can be used to iterate over a list, set, or map structure. But a ListIterator is only used to iterate through a list. For example Set<Integer> mSet = new HashSet<Integer>(); mSet.add(0); mSet.add(1); Iterator<Integer> mSetIterator = mSet.iterator(); // we cannot do Iterator<Integer> mSetIterator = mSet.listIterator(); List<Integer> mList = new ArrayList<Integer>(); mList.add(0); mList.add(1); // following two statements are valid for listRead More →

CopyOnWriteArrayList vs ArrayList in Java

CopyOnWriteArrayList vs ArrayList in Java

2018-12-03
By: Khawar Shehzad
On: December 3, 2018
In: Algorithms, Computing, Java, Programming, Technology
With: 0 Comments

CopyOnWriteArrayList and the ArrayList are part of the Collections framework. CopyOnWriteArrayList and ArrayList implement the List interface (just like Vector and LinkedList), but underlying implementations either support multi-threaded applications or single threaded applications. In CopyOnWriteArrayList, each mutative operation e.g. add, set etc are done after creating a copy of the underlying array. Since it uses a ‘snapshot’ style iterator and copy never changes for the lifetime of the iterator, it does not get a ConcurrentModificationException. In this lifetime, any modifications on the original one will not be available to that iterator which is working on the copy. You cannot use its iterator to do mutations otherwiseRead More →

ConcurrentHashMap vs HashTable in Java

ConcurrentHashMap vs HashTable in Java

2018-12-02
By: Khawar Shehzad
On: December 2, 2018
In: Algorithms, Computing, Programming
With: 0 Comments

ConcurrentHashMap uses multiple buckets to store data. Since HashTable locks the whole map, ConcurrentHashMap does not come with a performance impact as seen in HashTable (due to having multiple locks at the segment level (sharding) rather than the object level). ConcurrentHashMap and HashTable are thread-safe. The main difference lies in their performance. ConcurrentHashMap has a good performance than HashTable. I found a very helpful analogy online that says that HashTable provides the lock on the main door of your house, while ConcurrentHashMap locks each door within your house. You cannot do compound operations on ConcurrentHashMap, but they are supported in HashTable (due to them havingRead More →

Recent Posts

  • Converting Map to a List in Java
  • ListIterator vs Iterator in Java
  • CopyOnWriteArrayList vs ArrayList in Java
  • ConcurrentHashMap vs HashTable in Java
  • All About Singleton Design Pattern

RSS Techflux News

  • Self-driving car startup (Optimus Ride Inc)
  • Nike self-lacing kicks
  • Microsoft has rolled out its “12 Days of Faves” 
  • smartphones were taken offline
  • Snapchat threats to campus released
  • Apple ‘affirms’ iPhones have a major issue
  • Amazon to hire 50000 employees for new headquarters
  • Samsung is claiming to deliver 1 million foldable phones in 2019
  • Amazon Black Friday 2018 deals
  • Amazon ads are becoming bigger than google

Recent Comments

  • CHUKU DAVID on How to Write an Article on Technology
  • Roselyn on Epilepsy Types & Research on their Cure or Treatment
  • Håkan on Top 10 Movie Roles Of Carrie Fisher
  • Khawar Shehzad on Part 1 – A Mega List of Known Algorithms – Sorting
  • Adnan Aftab Chughtai on Part 1 – A Mega List of Known Algorithms – Sorting

Archives

  • December 2018
  • November 2018
  • May 2018
  • March 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • July 2016

Categories

  • Algorithms
  • Blog
  • Business
  • Careers
  • Computing
  • Design
  • Economics
  • Entertainment
  • Health
  • Java
  • Lifestyle
  • Marketing
  • opensource
  • Personality Spotlight
  • Product Spotlight
  • Programming
  • Science
  • Security
  • Service Spotlight
  • Spotlight
  • Technology
  • Travel & Tourism
  • Uncategorized
  • Viral

About

  • Privacy Policy
  • Terms of Use

Designed using Responsive Brix WordPress Theme. Powered by WordPress.