Shriansh Kumar has Published 324 Articles

JavaScript in filter an associative array with another array

Shriansh Kumar

Shriansh Kumar

Updated on 11-Sep-2024 10:59:11

1K+ Views

In this problem statement, our task is to write a JavaScript program by which we can simply filter an associative array with the help of another array. Before discussing the solution for the given problem, let's familiarize ourselves with associative array first. What is an associative array? An associative array ... Read More

JAVA Program to Replace Each Element of Array with its Next Element

Shriansh Kumar

Shriansh Kumar

Updated on 11-Sep-2024 10:56:49

1K+ Views

As per the problem statement we have to write a Java program to replace each element of the array with its next element. In Java, the array is an object. It is a non-primitive data type which stores values of similar data types. Before discussing the solution for the given ... Read More

Java Substring Comparisons

Shriansh Kumar

Shriansh Kumar

Updated on 11-Sep-2024 10:37:01

2K+ Views

Given a string and its substring(s) of length k, write a Java program to compare and find whether the substrings are equal or not. Substring is a small portion of characters from a large string. In Java, a String is a class that represents a contiguous block of characters. ... Read More

Java program to Count the number of digits in a given integer

Shriansh Kumar

Shriansh Kumar

Updated on 11-Sep-2024 10:36:31

22K+ Views

Suppose an integer number is given as an input, our task is to write a Java program to count the number of digits in that integer. For this problem, create a counter variable and initialize it with 0. Divide the given integer value with 10 till the integer becomes 0 ... Read More

Static blocks in Java with example

Shriansh Kumar

Shriansh Kumar

Updated on 11-Sep-2024 10:35:18

5K+ Views

A block of code that is associated with the static keyword is called as static block. This block executes when classloader loads the class. Remember, if your code contains any static block, it will be invoked before the main() method. In this article, we will learn how to create and ... Read More

Java Program to Illustrate Escaping Characters in Regex

Shriansh Kumar

Shriansh Kumar

Updated on 11-Sep-2024 10:23:59

1K+ Views

The special characters, also known as metacharacters, in Java Regex holds a specific meaning within the regex syntax and must be escaped if you want to use them as regular characters. Here, we will demonstrate escaping characters in Regex through Java Program. But, before diving deep into the topic, let ... Read More

Java Interview Questions on Constructors

Shriansh Kumar

Shriansh Kumar

Updated on 11-Sep-2024 10:18:51

953 Views

There could be numerous interview questions on Constructors, it is not possible to cover all in just one article. However, we have researched and assorted the most popular Java interview questions on Constructors. In most of the Java interviews, the interviewers always start by asking basic questions. They can test ... Read More

Java Menu Driven Program to Perform Queue Operation

Shriansh Kumar

Shriansh Kumar

Updated on 16-Aug-2024 08:17:30

1K+ Views

A queue is a linear data structure where elements are stored in the FIFO manner. Here, FIFO stands for First In First Out which means the first element inserted would be the first element to be accessed. In this article we will see how to perform different queue operations like ... Read More

Java Program to Get the First Element from LinkedHashSet

Shriansh Kumar

Shriansh Kumar

Updated on 16-Aug-2024 08:15:36

1K+ Views

LinkedHashSet is a class provided by Java that implements Set Interface. The first element of a LinkedhashSet is nothing but the first element in the collection. In this article, we will discuss different approaches to get the first element from LinkedHashset. What is a LinkedHashSet? A LinkedHashSet is a ... Read More

Java Program to find if an element is in Stack

Shriansh Kumar

Shriansh Kumar

Updated on 16-Aug-2024 08:07:16

2K+ Views

A stack is a linear data structure where elements are stored in the LIFO manner. Here, LIFO stands for Last In First Out which means the last element inserted would be the first element to be accessed. In Java, stack is a class provided by the Java collection framework ... Read More

Advertisements