Alshifa Hasnain has Published 283 Articles

Arrays vs Set in JavaScript.

Alshifa Hasnain

Alshifa Hasnain

Updated on 29-Mar-2025 02:56:35

2K+ Views

In this article, we will learn about the difference between an array and a set in JavaScript. Arrays are used to store ordered collections of elements, whereas in Sets, we can store only unique values. What is an Array?  An Array is an ordered, indexed collection of values in JavaScript. ... Read More

Convert HashSet to TreeSet in Java

Alshifa Hasnain

Alshifa Hasnain

Updated on 29-Mar-2025 02:56:23

1K+ Views

In this article, we will learn to convert a HashSet to a TreeSet in Java. Converting from one type of collection to another is a simple process when we require them to change their behavior or the nature of our data structure. Why Convert HashSet to TreeSet? For the following ... Read More

Java Program to Implement the Linear Congruential Generator for Pseudo Random Number Generation

Alshifa Hasnain

Alshifa Hasnain

Updated on 29-Mar-2025 02:56:11

557 Views

In this article, we will implement the linear congruential generator for pseudo random number generation in Java. Pseudo random number generator (PRNG) are mainly used in simulations, cryptography, or mathematical tasks. What is an LCG? A Linear Congruential Generator (LCG) is a technique to generate a sequence of numbers that looks ... Read More

What are the advantages of JavaScript?

Alshifa Hasnain

Alshifa Hasnain

Updated on 27-Mar-2025 19:34:35

5K+ Views

JavaScript is a dynamic computer programming language. It is lightweight and most commonly used as a part of the web pages, whose implementation allows a client-side script to interact with a user and to make dynamic pages. It is an interpreted programming language with object-oriented capabilities. Advantages of JavaScript ... Read More

How to enable JavaScript in Internet Explorer (IE)?

Alshifa Hasnain

Alshifa Hasnain

Updated on 27-Mar-2025 19:34:23

561 Views

To enable JavaScript in Internet Explorer (IE), follow the below-given steps: Opening Internet Options Click the gear icon on the right-hand side: Navigating to Security Settings Now, a dialog box will open. Go to the Security tab and click Custom level. After reaching the Security Settings, go to Scripting, ... Read More

Difference between List and Set in Java

Alshifa Hasnain

Alshifa Hasnain

Updated on 27-Mar-2025 19:34:11

3K+ Views

In Java, List and Set are both interfaces that belong to the Collection framework. Both interfaces extend the Collection interface. They are both used to store a collection of objects as a single unit. Before JDK 1.2, we used to use Arrays, Vectors, and Hashtable for grouping objects as a ... Read More

What is the character wrapper class and its methods in Java?

Alshifa Hasnain

Alshifa Hasnain

Updated on 26-Mar-2025 12:06:18

7K+ Views

In this article, we will learn about the character wrapper class and its methods in Java. The Character class is the primitive char type wrapper, providing useful methods for manipulation, classification, and conversion of characters. The Character Wrapper Class The Character class of the java.lang package wraps a value of ... Read More

What is the purpose of private constructor in Java?

Alshifa Hasnain

Alshifa Hasnain

Updated on 26-Mar-2025 12:05:52

854 Views

In this article, we will learn about the purpose of private constructor in Java. Constructor is a unique method used to initialize objects. Constructors are public or protected by default, which allows outside classes to create instances Why Use a Private Constructor? Private constructor is mainly applied to manage object ... Read More

Should I include type='text/javascript' in my SCRIPT tags?

Alshifa Hasnain

Alshifa Hasnain

Updated on 26-Mar-2025 12:04:57

2K+ Views

The type attribute in JavaScript is optional since the introduction of HTML5 brought some new improvements. JavaScript became the default language for HTML5 and modern browsers. So, now adding text/javascript isn’t required in tag. This attribute is what is now recommended to indicate the scripting language in use and ... Read More

What is a final parameter in java?

Alshifa Hasnain

Alshifa Hasnain

Updated on 26-Mar-2025 12:04:15

4K+ Views

In this article, we will learn about the final parameter in Java. In Java, you can pass final variables as parameters to methods. The final keyword can be used with variables, methods, and classes to add restrictions on their behavior. What is a Final Parameter? A final variable can be ... Read More

Advertisements