Category: Java

Why String is immutable in Java
Java

Why is string immutable in java? 

String is immutable in java becuase we can’t modifiy or change it once it is created. Basically Immutable itself means unmodifiable or unchangeable. In Java Once we created string object we cannot change and modify its data or state. Below is an example to see the immutability of String in…

How to reverse String In Java
Java

3 simple ways to reverse String in Java 

There are many possible ways to reverse String in Java. We can use a StringBuffer, StringBuilder, and iteration, etc. 1). Using a reverse() method of StringBuilder class 2). By Converting String to character array using toCharArray() and then reverse. Here we will first convert String in to a character array….

HashMap Implementation in Java
Java

HashMap Implementation in Java 

In Java HashMap is a very important and most used concept. It is mostly used in enterprise-level coding to mapping. Also, it is used in e-commerce applications to map orders with customers. Map is a class of collection in Java which is used to store data in Key & Value…