AmitDiwan has Published 11365 Articles

Java Program to Implement switch statement on strings

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 06:08:59

170 Views

In this article, we will understand how to implement switch statement on strings. The switch expression is evaluated once. The value of the expression is compared with the values of each case. String is a datatype that contains one or more characters and is enclosed in double quotes(“ ”).Below is ... Read More

Java Program to Replace the Spaces of a String with a Specific Character

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 05:49:41

867 Views

In this article, we will understand how to replace the spaces of a string with a specific character. String is a datatype that contains one or more characters and is enclosed in double quotes(“ ”).Below is a demonstration of the same −Suppose our input is −Input string: Java Program is ... Read More

Java Program to Join Two Lists

AmitDiwan

AmitDiwan

Updated on 29-Mar-2022 13:50:24

243 Views

In this article, we will understand how to join two lists. The ArrayList class extends AbstractList and implements the List interface. ArrayList supports dynamic arrays that can grow as needed.Array lists are created with an initial size. When this size is exceeded, the collection is automatically enlarged. When objects are ... Read More

Java Program to Convert a List of String to Comma Separated String

AmitDiwan

AmitDiwan

Updated on 29-Mar-2022 13:27:46

501 Views

In this article, we will understand how to convert a list of string to comma separated string. A list is an ordered collection that allows us to store and access elements sequentially. It contains the index-based methods to insert, update, delete and search the elements. It can also have the ... Read More

Java Program to Access elements from a LinkedList

AmitDiwan

AmitDiwan

Updated on 29-Mar-2022 12:54:08

317 Views

In this article, we will understand how to access elements from a linked-list. The java.util.LinkedList class operations perform we can expect for a doubly-linked list. Operations that index into the list will traverse the list from the beginning or the end, whichever is closer to the specified index.Below is a ... Read More

Java Program to Add Element at First and Last Position of a Linked list

AmitDiwan

AmitDiwan

Updated on 29-Mar-2022 12:41:13

263 Views

In this article, we will understand how to add element at first and last position of a linked list. The java.util.LinkedList class operations perform we can expect for a doubly-linked list. Operations that index into the list will traverse the list from the beginning or the end, whichever is closer ... Read More

Java Program to Differentiate String == operator and equals() method

AmitDiwan

AmitDiwan

Updated on 29-Mar-2022 12:30:48

153 Views

In this article, we will understand how to differentiate == operator and equals() method in Java. The == (equal to) operator checks if the values of two operands are equal or not, if yes then condition becomes true.The equals() method compares this string to the specified object. The result is ... Read More

Java Program to Remove a Sublist from a List

AmitDiwan

AmitDiwan

Updated on 29-Mar-2022 12:28:04

275 Views

In this article, we will understand how to remove a sub-list from a list. A list is an ordered collection that allows us to store and access elements sequentially. It contains the index-based methods to insert, update, delete and search the elements. It can also have the duplicate elements.Below is ... Read More

Java Program to Iterate through each character of the string.

AmitDiwan

AmitDiwan

Updated on 29-Mar-2022 12:27:43

1K+ Views

In this article, we will understand how to iterate through each character of the string. String is a datatype that contains one or more characters and is enclosed in double quotes (“ ”). Char is a datatype that contains an alphabet or an integer or a special character.Below is a ... Read More

Java Program to Clear the StringBuffer

AmitDiwan

AmitDiwan

Updated on 29-Mar-2022 12:21:28

1K+ Views

In this article, we will understand how to clear the StringBuffer. StringBuffer is a peer class of String that provides much of the functionality of strings. String represents fixed-length, immutable character sequences while StringBuffer represents growable and writable character sequences.Below is a demonstration of the same −Suppose our input is ... Read More

Advertisements