Articles on Trending Technologies

Technical articles with clear explanations and examples

Can we convert an array to list and back in Java?

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 323 Views

Yes, Java provides built-in methods to convert between arrays and lists. Use Arrays.asList() to convert an array to a list, and list.toArray() to convert a list back to an array. Array to List Use Arrays.asList() to convert an array into a list. Wrap it in an ArrayList constructor to get a modifiable list − List list = new ArrayList(Arrays.asList(array)); List to Array The List interface provides two toArray() methods − 1. Without parameter − Returns an Object[] array. Object[] items = list.toArray(); 2. With typed array − Returns ...

Read More

How to convert a Java list to a set?

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 305 Views

A Java List can be converted to a Set to eliminate duplicate entries. The resulting Set will contain only unique values. There are three common ways to perform this conversion − Method 1: Using Set Constructor Pass the list directly to the HashSet constructor − Set set = new HashSet(list); Method 2: Using addAll() Create an empty set and use addAll() to add all elements from the list − Set set = new HashSet(); set.addAll(list); Method 3: Using Streams (Java 8+) Use the Stream API to collect list ...

Read More

How to check the Java list size?

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 857 Views

The Java List interface provides a size() method to check the current number of elements in the list. The size updates automatically as elements are added or removed. Syntax int size() Returns the number of elements in the list. If the list contains more than Integer.MAX_VALUE elements, it returns Integer.MAX_VALUE. Example The following example shows how the list size changes after adding and removing elements ? import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class CollectionsDemo { public static void main(String[] args) { ...

Read More

How do I add multiple items to a Java ArrayList in single statement?

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 3K+ Views

We can use Arrays.asList() method to add multiple items to a Java ArrayList in a single statement. This method returns a fixed-size list backed by the specified array, which we then pass to the ArrayList constructor to create a modifiable list. Syntax public static List asList(T... a) Returns a fixed-size list backed by the specified array. T − The runtime type of the array. a − The array by which the list will be backed. Note − The list returned by Arrays.asList() is fixed-size, meaning you cannot add or remove ...

Read More

Adobe Photoshop - Photo and Design Software

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 2K+ Views

Adobe Photoshop is the most popular photo editing and design software in the world. It is available for Windows, macOS, and iPad. Adobe Photoshop is an industry standard in photo editing and digital art − so widely used that "photoshop" has become a verb (to photoshop an image). It is a proprietary software owned by Adobe Inc. Key Features Multiple Layers Editing − Edit and develop raster images in multiple layers with support for masking and alpha compositing. Color Models − Supports RGB, CMYK, CIELAB, spot color, duotone, and more. Vector Images − Edit vector images alongside ...

Read More

Difference between Fedora and CentOS

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 306 Views

Fedora and CentOS are both Linux-based, open-source operating systems from the Red Hat ecosystem. Fedora focuses on delivering the latest technologies for developers, while CentOS provides a stable, free alternative to RHEL for production server environments. Fedora Fedora is an open-source Linux distribution intended for developers and system administrators. It is developed by the Fedora Project community and sponsored by Red Hat. Introduced in September 2003 (initially known as Fedora Core), it delivers cutting-edge software with new releases approximately every six months. CentOS CentOS (Community Enterprise Operating System) is a free, open-source Linux distribution built from ...

Read More

Difference between Fedora and Red Hat

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 1K+ Views

Fedora and Red Hat Enterprise Linux (RHEL) are both Linux-based operating systems from the Red Hat ecosystem. Fedora is the free, community-driven distribution that serves as a testing ground for new technologies, while RHEL is the commercial, enterprise-grade distribution built for production environments. Fedora Fedora is an open-source, free-to-use Linux distribution intended for developers and system administrators. It was introduced in September 2003 (initially known as Fedora Core) and is supported by the Red Hat community. Fedora delivers the latest software and technologies with new releases approximately every six months. Red Hat (RHEL) Red Hat Enterprise ...

Read More

Difference between Fedora and Debian

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 349 Views

Fedora and Debian are both popular Linux-based, open-source operating systems. Fedora is backed by Red Hat and targets developers with cutting-edge software, while Debian is community-driven and known for its stability and massive package repository. Fedora Fedora is a Linux-based operating system primarily intended for developers and system administrators. It is supported by the Red Hat community and was introduced in September 2003 (initially known as Fedora Core). Fedora focuses on delivering the latest software and technologies with frequent release cycles (approximately every 6 months). It uses the dnf package manager with .rpm packages. Debian Debian ...

Read More

Difference between Python and Bash

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 1K+ Views

Python and Bash are both widely used in automation and scripting, but they serve different purposes. Python is a full-featured, object-oriented programming language, while Bash is a command-line interpreter (shell) designed for running system commands and small scripts. Python Python is a dynamically typed, object-oriented programming language designed to be simple and easy to understand. It supports a rich ecosystem of third-party libraries and is used for web development, data science, automation, AI, and much more. Bash Bash (Bourne Again Shell) is a command-line interpreter and the default user shell on Linux and macOS. It was ...

Read More

Difference between Pipes and Message Queues

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 3K+ Views

Pipes and Message Queues are both Inter-Process Communication (IPC) mechanisms in Unix/Linux systems. Pipes provide a simple unidirectional byte stream between processes, while message queues provide a more flexible, bidirectional mechanism for exchanging discrete messages with optional priorities. Unix Pipes A pipe provides a unidirectional flow of data between processes. It is created using the pipe() function, which returns two file descriptors − one for reading and one for writing. Both the sender and receiver processes must be running simultaneously for a pipe to function. Message Queues A message queue allows a sender process to write ...

Read More
Showing 1–10 of 61,260 articles
« Prev 1 2 3 4 5 6126 Next »
Advertisements