Aishwarya Naglot has Published 180 Articles

Constructor Chaining In Java programming

Aishwarya Naglot

Aishwarya Naglot

Updated on 01-Sep-2025 13:19:16

1K+ Views

The constructor chaining is a specific sequence of calling constructors when a user initializes an object in a certain way. This technique is used when multiple constructors are invoked one after another, based on the instance class. It is also closely related to inheritance, where the role of a subclass ... Read More

Java program to lookup enum by string value

Aishwarya Naglot

Aishwarya Naglot

Updated on 01-Sep-2025 12:56:48

876 Views

An enum is a special "class" that represents a group of constants (unchangeable variables, like final variables). For example, we have constants like week days, months, or set of languages etc. In Java, we can create an enum to represent these constants. In this article, we will learn how ... Read More

How to remove a SubList from an ArrayList in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 01-Sep-2025 12:52:19

2K+ Views

In this article, let's learn how to remove a sublist from an ArrayList in Java. The ArrayList class is a part of the Java Collections Framework. It is a resizable array and an implementation of the List interface. The ArrayList class is used when we want to store a list ... Read More

How do we check if a String contains a substring (ignoring case) in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 01-Sep-2025 12:51:02

5K+ Views

Problem Statement The task is, given a string and a substring, you have to check if a substring is present in a string or not. Do not mind if the case of the string and substring is different, it should not matter. For example, if the string is "Hello World" ... Read More

Sorting contents of a string that holds integer values in Java

Aishwarya Naglot

Aishwarya Naglot

Updated on 01-Sep-2025 12:50:16

4K+ Views

Problem Statement Here we have a string that contains integer values, our task is to sort those integer values in ascending order. For example, if the string is "31134", the sorted string should be "11334". Solution We can solve the above problem using multiple ways: ... Read More

How to get first and last elements from ArrayList in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 01-Sep-2025 12:48:08

16K+ Views

ArrayList is a part of the Java Collections Framework. Which is a dynamic type of array that can grow and shrink as needed. It is a resizable array implementation of the List interface. The ArrayList class is used when we want to store a list of elements in a dynamic ... Read More

How can a String be validated (for alphabets) in java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 01-Sep-2025 12:45:51

5K+ Views

Problem Statement The given problem is to validate a string to check if that string contains only alphabets (both uppercase and lowercase) and does not contains any other characters like numbers, special characters, etc.. For example, the string "HelloWorld" is valid as it contains only alphabets, while "Hello123" is not ... Read More

How to create a variable that can be set only once but isn\'t final in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 01-Sep-2025 12:43:48

2K+ Views

How to create a variable that can be set only once, meaning it can be assigned a value only once but is not final in Java? Solution In Java we can solve the above using the following two methods: Using a custom wrapper class Using an AtomicReference Using ... Read More

How do we find out if first character of a string is a number in java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 01-Sep-2025 12:40:40

4K+ Views

In this tutorial, we will learn how to find out if the first character of a String is a digit in Java. Following are the different ways to do so: Using the isDigit() method. Using the regular expressions. Using the charAt() and isDigit() methods. Using the ... Read More

How to Convert a String to Hexadecimal and vice versa format in java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 01-Sep-2025 12:37:22

18K+ Views

In this article, we will learn how to convert a string to hexadecimal and hexadecimal to string in Java. Hexadecimal is a base-16 number system that uses 16 symbols to represent a number. Those symbols can be 0-9 and A-F letters. String to Hexadecimal in Java To convert a ... Read More

Advertisements