Vivek Verma has Published 113 Articles

Difference between ArrayList and HashSet in Java

Vivek Verma

Vivek Verma

Updated on 05-May-2025 14:47:43

16K+ Views

In Java, ArrayList and HashSet are the most important classes of the Collection Framework. Both are used to "store collections of elements", but they are used for different purposes and have different characteristics. ArrayList is an "ordered collection" that allows duplicate elements, while HashSet is an "unordered collection" that does ... Read More

How to get the string representation of numbers using toString() in Java?

Vivek Verma

Vivek Verma

Updated on 05-May-2025 14:35:24

742 Views

String representation of numbers is nothing but converting numeric values into their corresponding string values using methods like toString(). In Java, this can be done by calling the toString() method on wrapper classes such as Integer, Float, and Double. The toString() method is an important method of Object class and ... Read More

How to check if the string ends with specific substring in Java?

Vivek Verma

Vivek Verma

Updated on 05-May-2025 14:19:02

1K+ Views

This article will discuss how to check if a string ends with a specific substring, which means we need to verify whether the last part of the string matches a given sequence of characters or not. For example, if the given input string values are "Gaint", "allegiant", "applicant", "combatant", "elephant", ... Read More

How can we initialize a boolean array in Java?

Vivek Verma

Vivek Verma

Updated on 05-May-2025 13:46:37

24K+ Views

Initializing a Boolean Array in Java refers to the process of assigning values (allocating memory) to the Boolean array for the first time. We can initialize an array or any variable - Either at the time of creation. Or, later in the ... Read More

Create a Calculator using HTML, CSS, and JavaScript

Vivek Verma

Vivek Verma

Updated on 12-Jul-2024 17:53:45

96K+ Views

To create a calculator using HTML, CSS, and Javascript, we need to have basic understanding of working of HTML, CSS and JavaScript. Calculator is a simple tool which performs basic arithmetic calculations like Addition, Subtraction, Multiplication and Division. In this article, we are going to discuss how to create a ... Read More

How to add an element to a JavaScript object?

Vivek Verma

Vivek Verma

Updated on 02-Sep-2023 11:27:38

74K+ Views

In JavaScript, the object is a real-time entity that contains properties and methods. In simple words, we can say that object is an instance of a class. It stores the data in the form of key and value pairs. The keys are usually referred to as properties and the values ... Read More

How to toggle between a like/dislike button with CSS and JavaScript?

Vivek Verma

Vivek Verma

Updated on 02-Nov-2022 10:52:20

2K+ Views

The toggle between one button to another button means it allows the user to switch one window to another window, it allows to turn on and off a function, allows to change settings, and provides much more functionality. But in this article we have to write a program with the ... Read More

JavaScript Convert an array to JSON

Vivek Verma

Vivek Verma

Updated on 02-Nov-2022 10:47:32

2K+ Views

An array is a special object in JavaScript, that stores multiple types of values which means that it can store an integer value, string value, or float value simultaneously. There are various ways to create an array in JavaScript, following is the syntax to do so − var array = ... Read More

How to create custom range sliders with CSS and JavaScript?

Vivek Verma

Vivek Verma

Updated on 02-Nov-2022 10:33:12

922 Views

A range slider, is an input field in HTML, that accepts the type as a “range”. It is used to select a numeric value within the given specific range, we can pass the range inside the input field as shown below snippet of code As you can see ... Read More

Write a palindrome program in JavaScript so that only alphanumeric values should be allowed?

Vivek Verma

Vivek Verma

Updated on 29-Aug-2022 11:45:34

800 Views

Palindrome is a string that even when reversed will be the same as the original string. In simple words, the palindrome string will have odd length and the element in 0th index and the last index will be the same, element in 1st index will be the same as the ... Read More

Advertisements