AmitDiwan has Published 11365 Articles

Java Program to Check if a string contains a substring

AmitDiwan

AmitDiwan

Updated on 10-Aug-2023 12:27:57

2K+ Views

A string is a class in Java that stores a series of characters enclosed within double quotes and a continuous sequence of characters within that string is termed as substring. Those characters are actually String-type objects. This article aims to write Java programs to check if a string contains a ... Read More

Java Program to Calculate Simple Interest

AmitDiwan

AmitDiwan

Updated on 10-Aug-2023 12:18:20

2K+ Views

The agenda of this article is to write a Java program to calculate simple interest. But, before doing it programmatically, let's understand how we calculate simple interest mathematically. The simple interest is a technique to determine the amount of interest gained on a principal amount at the specified interest rate ... Read More

Java Program to Add elements to a LinkedList

AmitDiwan

AmitDiwan

Updated on 10-Aug-2023 12:14:07

252 Views

LinkedList is a generic class of Java Collection Framework that implements three interfaces namely List, Deque, and Queue. It provides the features of a LinkedList data structure which is a linear data structure where each element are linked with each other. There are several operations we can perform on LinkedList ... Read More

Java Program for array rotation

AmitDiwan

AmitDiwan

Updated on 10-Aug-2023 12:12:06

311 Views

An array is a linear data structure that is used to store a group of elements with similar datatypes. It stores data in a sequential manner. Once we create an array we can't change its size i.e. it can store a fixed number of elements. The array comes with a ... Read More

Java multiplyExact() in Math

AmitDiwan

AmitDiwan

Updated on 10-Aug-2023 12:10:00

184 Views

In Java, multiplyExact() is an in-built static method of the Math class that accepts two arguments and returns their product as a result. This method can accept values of either integer or long type. One important point to note is that it may throw an exception if the produced result ... Read More

Java Interview Questions on Constructors

AmitDiwan

AmitDiwan

Updated on 10-Aug-2023 12:08:16

493 Views

In most of the Java interviews, the interviewers always start by asking basic questions. They can test one's knowledge in just a few minutes of the interviews. Therefore, it is essential to get thorough with the fundamental concepts of Java such as class, object and constructor. In this article, we ... Read More

IntUnaryOperator Interface in Java

AmitDiwan

AmitDiwan

Updated on 10-Aug-2023 11:56:18

160 Views

IntUnaryOperator Interface, a functional interface of Java that performs an operation on a single integer-valued operand and also returns an integer value as a result. Since it is a functional interface, we can use it as an assignment target for the lambda expressions or method references. Here, the functional interface ... Read More

How to add class to an element without addClass() method in jQuery?

AmitDiwan

AmitDiwan

Updated on 10-Apr-2023 14:49:19

6K+ Views

We can use the .attr() method to add a class to an element. This method can be used to set or get the value of an attribute on an HTML element. To add a class, we first select the element using a jQuery selector, and then call the .attr() method, ... Read More

Computing the Cartesian Product of Two Sets in JavaScript

AmitDiwan

AmitDiwan

Updated on 31-Mar-2023 15:40:15

191 Views

Cartesian Product Inset theory a Cartesian product is a mathematical operation that returns a set (or product set or simply product) from multiple sets.That is, for sets A and B, the Cartesian product A × B is the set of all ordered pairs (a, b) where a ∈ A and b ... Read More

Computing the Cartesian Product of Multiple Arrays in JavaScript

AmitDiwan

AmitDiwan

Updated on 31-Mar-2023 15:39:43

477 Views

We are required to write a JavaScript function that takes in multiple arrays of numbers. The function should return an array of the cartesian product of the elements from all the arrays.For example −If the input arrays are −[1, 2], [10, 20], [100, 200, 300]Then the output should be −const ... Read More

Advertisements