immutable

java.lang.UnsupportedOperationException while adding element to List created from Arrays.asList()

The arraylist which is created using below line of code is immutable. The reason behind is the list still backed/aided by the array and we all know pretty well that the size of the array cannot be changed. The Arrays.asList returns the arraylist which is the inner class with the name as arraylist. This list does not have methods that performs any modification to the arraylist add, remove etc. It is an inner class which extends abstract class AbstractList but not…

0
Read More

What does const stand for in ES6?

Lot of changes are happening in JavaScript. ES6 shifted standard of JavaScript language to one level up. const is one of the concept ,that is introduced as apart of ES6 standard. Those, who came from the C or Java , they have different meaning for this. const in JavaScript means “one-time assignment” . It doesn’t mean constant. It means you can assign the a variable or object once. But doesn’t mean immutable. The immutable concept require explanations. We will understand in below examples.

0
Read More