
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 7442 Articles for Java

19K+ Views
By taking advantage of Java 8 functional programming features like the Stream API and streams and lambda expressions, extracting unique values from an ArrayList becomes simpler and quicker. Leveraging these capabilities you can extract distinct elements without tedious iterations or manual checks; lambda expressions allow concise yet readable code which makes this task even simpler. Whether dealing with large datasets or simply eliminating duplicates Java 8 offers powerful yet elegant solutions for retrieving unique values from an ArrayList. ArrayList Java's ArrayList class implements the List interface, providing dynamic array-like functionality for storage and manipulation of collections of elements within ... Read More

2K+ Views
Java's TreeMap class implements the SortedMap interface and offers an ordered key-value mapping system. Although TreeMap relies mainly on keys for retrieval, in certain circumstances index accessing may become necessary - however there are no direct methods in TreeMap that let developers directly retrieve elements based on index position like List or Array do. One solution would be converting your TreeMap keys or values into List or ArrayList before accessing their respective indexs using either method - thus giving developers all of the benefits associated with TreeMap while still having index access when necessary. Index in Java An ... Read More

2K+ Views
Acquiring values of system properties and environment variables plays a pivotal role in accessing critical configuration information within applications written using Java. System properties encompass various elements of a system, such as its Java installation directory or version number or user preferences. Environment variables, on the other hand, are dynamic values set either by an operating system or user that impact application performance. By accessing these properties and variables, you gain invaluable insights into the system configuration that enable you to adapt your code accordingly for greater compatibility, customization and seamless integration into its surrounding environment. Environment ... Read More

817 Views
Retrieving the last element from a LinkedHashSet in Java means retrieving its final element present in its collection. Although Java does not come equipped with built-in methods to help retrieve this last item from its LinkedHashSets, multiple effective techniques exist that provide flexibility and convenience, efficiently retrieving this final element without disrupting insertion order - something Java developers must contend with effectively within their apps. By employing such strategies effectively into their software projects they can achieve optimal solutions to meet this requirement efficiently. LinkedHashSet LinkedHashSet is an efficient data structure in Java that combines features from HashSet ... Read More

1K+ Views
In Java, concurrent programming often involves managing multiple threads and distinguishing them from one another. One crucial aspect of thread management is obtaining the unique identifier of the currently running thread. Knowing how to get the ID of a current running thread is essential for tasks like tracking thread behavior, synchronization, and debugging. This tutorial explores various Java methods to do just this. Thread Java's threads are lightweight units of execution within programs, providing parallel execution of tasks and providing one sequential flow of control within them allowing programs to carry out multiple operations concurrently. Each thread runs independently ... Read More

2K+ Views
Introduction Message passing, a method of transferring communications among items or threads, is an essential idea in distributed systems and parallel programming. The transmission of messages in Java may be accomplished with an assortment of methods and structures, based on the implementation's particular needs Using the power source java.util.concurrent the container, which offers an array of interfaces and class libraries for establishing and handling threads that are active locks, and synchronization mechanisms, is a single method for implementing passing messages in Java, for instance. An Executor interface, for instance, is able to be utilized without delay to carry out duties, ... Read More

1K+ Views
Threads are an important aspect of Java programs. They are also known as lightweight processes. Every program in Java has at least a main thread. They play a very important role to run multiple tasks at the same time. They run in the background and do not affect the execution of the main program. The use of multiple threads simultaneously is called multithreading. States of a Thread A thread can exist in either of the following states. It has a complete lifecycle from its creation to destruction. The thread lifecycle states are- ... Read More

6K+ Views
Input and output are the vital components of all the programming languages. Same is the case with Java. User input is very crucial for creating dynamic and interactive applications. Usually the input is a single value but we can also take input from the user separated by space. This article deals with how to take input from the user separated by spaces in Java. Ways to Take Input From User Separated By Space in Java There are 2 ways by which we can take the input from the user separated by space. They are as follows- ... Read More

220 Views
At times, we need information related to a class file. In such a case, we can use the javap tool provided by the Java Development Kit (JDK). We can get more information related to the methods, constructors, and fields present in the class. The purpose of the javap tool is to disassemble one or more class files. It is also known as Java Class File Disassembler. Using the javap tool, we can get more information about the bytecode information about that particular class. The output may vary depending on the options used. Syntax The syntax of javap is ... Read More

991 Views
A TreeSet in Java stores unique elements in sorted order. It implements the SortedSet interface. The TreeSet interface internally uses a balanced tree called the Red-Black tree. A List in Java is a data structure that is used to store elements in the order in which they were added. We can create a TreeSet with a List in Java in many ways. This article deals with the ways in which a TreeSet can be created using a List in Java. Ways to Create a TreeSet with a List in Java There are 3 ways by which a TreeSet ... Read More