Alshifa Hasnain has Published 283 Articles

JavaScript Array Ranking

Alshifa Hasnain

Alshifa Hasnain

Updated on 22-Jan-2025 00:46:49

727 Views

In this article, we will learn to rank elements in arrays using JavaScript. Ranking elements in an array is common in various applications, such as sorting scores, evaluating performance, or analyzing data. What is Array Ranking? Array ranking involves assigning a rank to each element of an array based on ... Read More

JavaScript: How to return True if the focus is on the browser tab page?

Alshifa Hasnain

Alshifa Hasnain

Updated on 22-Jan-2025 00:45:44

1K+ Views

In this article, we will learn to check if the browser tab page is focused and under use or not in JavaScript. This is mainly required to record the user’s inactivity time on the app and then take any action upon it if required. Use Cases for Monitoring Browser Tab ... Read More

Java program to reverse an array

Alshifa Hasnain

Alshifa Hasnain

Updated on 20-Jan-2025 19:19:59

1K+ Views

In this article, we will learn to reverse an array in Java. Reversing an array is a classic problem that helps understand essential concepts like data structures and in-place manipulation. This operation is commonly required in programming tasks, such as data transformations, algorithm implementations, and solving logical problems. Problem Statement ... Read More

Create array from JSON object JavaScript

Alshifa Hasnain

Alshifa Hasnain

Updated on 20-Jan-2025 19:19:41

1K+ Views

In this article, we will learn to create an array from JSON data in JavaScript. JSON is a widely used format for storing and exchanging data. A common use case involves extracting specific data from a JSON object or array and converting it into a separate array for further processing. What is ... Read More

Java ResultSet isAfterLast() Method with Examples

Alshifa Hasnain

Alshifa Hasnain

Updated on 20-Jan-2025 19:19:15

875 Views

The ResultSet interface in Java is used to retrieve data from a database in a tabular form. The isAfterLast() method is one of the navigation methods in the ResultSet that helps in checking the position of the cursor. Specifically, isAfterLast() checks whether the cursor is positioned after the last row ... Read More

JavaScript Quicksort Recursive

Alshifa Hasnain

Alshifa Hasnain

Updated on 17-Jan-2025 19:47:24

986 Views

In this article, we will learn to implement Quicksort recursively in JavaScript. Quicksort is one of the most efficient and widely used sorting algorithms, known for its divide-and-conquer approach. What is Quicksort? Quicksort is a divide-and-conquer sorting algorithm that sorts an array by selecting a pivot element and partitioning ... Read More

Java Program to Sort map by keys

Alshifa Hasnain

Alshifa Hasnain

Updated on 17-Jan-2025 19:45:03

640 Views

In this article, we will learn to sort maps by keys in Java. In Java, the Map interface provides a collection of key-value pairs where each key is unique. Sorting a map by its keys can be useful when you want to order the elements based on the keys instead ... Read More

Java Program to append a row to a JTable in Java Swing

Alshifa Hasnain

Alshifa Hasnain

Updated on 17-Jan-2025 19:44:35

1K+ Views

Adding rows dynamically to a JTable is a common task in Java Swing when working with user interfaces that involve tabular data. This article walks you through creating a Java Swing application that appends a new row to a JTable when the user inputs data and clicks a button. What ... Read More

Java Concurrency – yield() method

Alshifa Hasnain

Alshifa Hasnain

Updated on 17-Jan-2025 19:44:20

862 Views

In this article, we will learn that concurrency in Java allows multiple threads to execute simultaneously, sharing system resources efficiently. One of the methods provided in the Thread class for managing thread execution is the yield() method. What is the yield() Method? The yield() method is a static method of ... Read More

Java Program to Initialize a List

Alshifa Hasnain

Alshifa Hasnain

Updated on 16-Jan-2025 20:22:23

943 Views

In this article, we will learn to initialize a list in Java. A list is an ordered collection that allows us to store and access elements sequentially. It contains index-based methods to insert, update, delete, and search the elements. It can also have duplicate elements. Problem Statement Given a scenario ... Read More

Advertisements