Found 34483 Articles for Programming

Java Program to Get First or Last Elements from HashSet

Shiva Keerthi
Updated on 24-Jun-2024 15:06:22

2K+ Views

In Java, HashSet is a class which implements Set Interface. HashSet is a collection of unique elements which doesn’t store or allow us to store duplicate elements. In this section, we will be discussing about different approaches in java to find the first element and last element of a HashSet using Java programming Language. The HashSet class in java is implemented using a hash table. It uses hash code to retrieve data quickly from the table in HashSet, the order of elements is not preserved i.e., it doesn’t store the elements in the order in which we add elements ... Read More

Java Program to Get System IP Address in Windows and Linux Machine

Shiva Keerthi
Updated on 16-Aug-2023 09:09:01

907 Views

IP Address, also known as the Internet Protocol Address is a unique identifier that is assigned to a device in a network to identify the devices in the network and establish connection between them. In this section, we will learn how to find the IP Address of a Windows and Linux Machine using Java Code. IP address can be represented in two formats. One format is IPv4 which is a 32 format containing decimals and dots. It has two parts, one part is network ID which identifies network and the other is host ID which identifies the device in ... Read More

Java Program to Get Elements by Index from LinkedHashSet

Shiva Keerthi
Updated on 03-Jul-2024 16:17:11

1K+ Views

LinkedHashSet is a class provided by Java which Implements Set Interface. LinkedHashSet is implemented as a hash table with a linked list running through it, so it is more efficient that HashSet and also maintains orders. It is useful when you need a collection that maintains order and does not allow duplicates. In this section, we will discuss different approaches to get the elements from LinkedHashset by index. What is a LinkedHashSet? A LinkedHashSet is a collection which is a combination of HashSet collection and a LinkedList collection. A HashSet is an unordered collection and also doesn’t allow duplicates. ... Read More

Java Program to Get Last Modification Date of a File

Shiva Keerthi
Updated on 16-Aug-2023 09:02:31

2K+ Views

Last Modification Date of a File refers to the last date on which the file data is edited. We have various functions in java to find the last modification date of a file. In this section, we will be discussing different approaches of implementing a java program to get the last modification date of a file. File is a collection of information which may contain data such as text information, images, audio, videos, program code. These can be accessed by any software applications to perform actions like read, write, update, delete etc. We will now look in to each function ... Read More

Python sorted containers - An Introduction

Mrudgandha Kulkarni
Updated on 11-Aug-2023 17:32:27

458 Views

Python offers a wide range of data structures to efficiently organize and manipulate data. When it comes to handling sorted data, sorted containers play a crucial role. Sorted containers are data structures that maintain the elements in a sorted order, providing fast access, insertion, and deletion operations. They offer an effective solution for scenarios where maintaining a sorted order is essential. In this blog post, we will explore the world of Python sorted containers and understand their significance in various applications. We will delve into the different types of sorted containers, such as sorted lists, sorted sets, and sorted dicts, ... Read More

Python Seaborn - Strip plot illustration using Catplot

Mrudgandha Kulkarni
Updated on 11-Aug-2023 17:24:15

136 Views

Data visualization plays a crucial role in understanding and communicating patterns, trends, and insights from data. Python, with its rich ecosystem of libraries, offers powerful tools for creating visually appealing and informative plots. Seaborn, a popular data visualization library built on top of Matplotlib, provides a high-level interface for creating beautiful statistical graphics. In this article, we will explore one of Seaborn's versatile plot types - the strip plot. Strip plots are useful for visualizing the distribution of a continuous variable against a categorical variable. They display individual data points along an axis, making it easy to observe patterns, clusters, ... Read More

Python Script to Shutdown Computer

Mrudgandha Kulkarni
Updated on 11-Aug-2023 17:22:30

4K+ Views

In today's fast-paced digital world, being able to automate computer tasks can greatly enhance productivity and convenience. One such task is shutting down a computer, which can be time-consuming if done manually. Thankfully, Python provides us with a powerful set of tools to interact with the system and automate such tasks. In this blog post, we will explore how to write a Python script to shut down a computer with ease. Whether you want to schedule automatic shutdowns, initiate a shutdown remotely, or simply save time by avoiding manual shutdowns, this script will come in handy. Importing Required Modules Before ... Read More

Python Script to Restart Computer

Mrudgandha Kulkarni
Updated on 11-Aug-2023 17:20:32

3K+ Views

Restarting a computer is a common task that we often perform to troubleshoot issues, install updates, or apply system changes. While there are various ways to restart a computer, using a Python script can provide automation and convenience. In this article, we will explore how to create a Python script that can restart a computer with a simple execution. We will start by discussing the importance of restarting a computer and the benefits it can offer. Then, we will delve into the implementation details of the Python script, explaining the necessary modules and functions involved. Throughout the article, we will ... Read More

Python Script to Shutdown your PC using Voice Commands

Mrudgandha Kulkarni
Updated on 11-Aug-2023 17:17:22

227 Views

In today's world of automation and smart devices, voice control has become increasingly popular. From smartphones to virtual assistants, voice commands offer a convenient and hands-free way to interact with technology. What if you could extend this convenience to your PC as well? Imagine being able to shut down your computer with a simple voice command, saving you the trouble of manually navigating through menus or using the mouse. In this blog post, we will explore how to use Python to create a script that allows you to shut down your PC using voice commands. By leveraging the power of ... Read More

Java Program to get the Size of Collection and verify that the Collection is Empty

Shiva Keerthi
Updated on 16-Aug-2023 09:04:15

175 Views

Collections in Java is a framework which provides classes and interfaces to manipulate group of objects. Collections help in storing and manipulating different types of objects in java. Size of the collection tells us how many elements are present in that particular collection. Java provides various collection classes namely ArrayList, LinkedList, HashSet, and TreeSet, among others. In this section, we are going to write a java program to get the size of collection and verify the collection is empty or not. The different types of collections in Java are − List − List is an ordered collection of objects ... Read More

Advertisements