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…
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….
How to use equals method in Java with example
In Java, there is a equals() method which is used to compare strings. This comparison of strings are based on the content of the string. How the equals() method works in Java? equals() methods compare two strings and if all characters of a string is not matched then it will…
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…
Write the Characteristics of c language
C is a structured programming language. It was developed in 1973 by Dennis Ritchie at AT & T Bell Laboratories. It is very popular programming languages today because of its structure, fast, high-level abstraction, machine independent feature. Characteristics of āCā Language It has a very small size The major use…
a ternary operator in c language explain
Instead of writing longer if and else conditional statements most of the programmer prefer to use the ternary operator for decision making. In c programming language ternary operator take three arguments: The first argument is for comparison The second argument is the result which will be print/return when the condition…