Vivek Verma has Published 113 Articles

How to remove the HTML tags from a given string in Java?

Vivek Verma

Vivek Verma

Updated on 28-Aug-2025 17:06:02

20K+ Views

A String is a final class in Java, and it is immutable, it means that we cannot change the object itself, but we can change the reference to the object. The HTML tags can be removed from a given string by using the following approaches: ... Read More

Add number strings without using conversion library methods in JavaScript

Vivek Verma

Vivek Verma

Updated on 28-Aug-2025 16:55:34

218 Views

We are required to write a JavaScript program that adds two numbers represented as strings, without using any conversion library or built-in methods. For example, If the input number strings are '11' and '23', the output should be '34'. In JavaScript, a number is considered a string-represented number when the ... Read More

(limits.h) in C/C++

Vivek Verma

Vivek Verma

Updated on 28-Aug-2025 16:45:39

1K+ Views

Both and "limits.h" are header files in C and C++ that are used to define constants related to data type limits. Header files are usually created with a .h extension and are used to declare functions, variables, and other entities without having a main() function. You can also create ... Read More

Add elements to a Queue using Javascript

Vivek Verma

Vivek Verma

Updated on 28-Aug-2025 16:19:52

380 Views

In JavaScript, there is no such data structure concept as a Queue like other programming languages. But you can implement a queue in JavaScript using an array object. You can perform all the operations such as push() method to add element at end and shift() to remove first element. The ... Read More

How can we convert character array to a Reader in Java?

Vivek Verma

Vivek Verma

Updated on 28-Aug-2025 16:19:10

419 Views

Converting a character array to a reader in Java means treating the array as a stream of characters to be read sequentially. Let's quickly learn about character array and its creation in Java: In Java, a character array is an array that holds elements of only char type, and it ... Read More

Can a constructor be synchronized in Java?

Vivek Verma

Vivek Verma

Updated on 28-Aug-2025 16:19:04

2K+ Views

No, a constructor cannot be synchronized in Java. If you try to use the synchronized keyword before a constructor, it may throw a compile-time error in the IDE. Synchronization is a mechanism used to control the access of multiple threads to any shared resource. When multiple threads access any shared ... Read More

Can we define a package after the import statement in Java?

Vivek Verma

Vivek Verma

Updated on 28-Aug-2025 16:13:17

635 Views

No, we cannot define a package after the import statement in Java. The compiler will throw an error if we try to insert a package after the import statement. A package is a group of similar types of classes, interfaces, and sub-packages. To create a class inside a package, declare ... Read More

Adding default search text to search box in HTML with JavaScript?

Vivek Verma

Vivek Verma

Updated on 28-Aug-2025 16:10:11

510 Views

A default search text is a text that provides suggestions or a hint of what to search for in the search (input) box. Following is an illustration of a search box, where you can observe a default search text "Search your favorite tutorials…" : The above default search text ... Read More

Achieving maximum possible pair sum in JavaScript

Vivek Verma

Vivek Verma

Updated on 28-Aug-2025 15:57:09

219 Views

Maximum Possible Pair Sum The maximum possible pair sum is a traditional problem in Data Structures and Algorithms (DSA). In this problem, we calculate the sum of two elements (i.e., pairs) in an array such that the resulting sum is the maximum among all possible pair sums. For example, we ... Read More

How To Check Whether a Number is a Narcissistic Number or Not in Java?

Vivek Verma

Vivek Verma

Updated on 28-Aug-2025 15:47:12

3K+ Views

What is a Narcissistic Number? A number is said to be a Narcissistic number, only if the addition (or sum) of the value of each digit raised to the power of the total number of digits available in the original number is equal to the original number. Examples of narcissistic ... Read More

1 2 3 4 5 ... 12 Next
Advertisements