
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 9122 Articles for Object Oriented Programming

262 Views
Online judge is a platform that serves to compile, execute and evaluate programming solutions to a given problem. It is widely used for problem solving and organizing programming contests. To create a basic online judge in Java using ProcessBuilder class, define an instance of ProcessBuilder and specify the name of program and commands as arguments The ProcessBuilder class is used to create and manage operating system processes. It allows us to chain multiple processes, where the output of one process can be used as the input to another process. Also, it provides a variety of built-in methods such as redirectOutput(), ... Read More

5K+ Views
While developing any Java application, we may require to use external libraries or modules that are packaged as JAR files. To use a JAR file in those Java applications, we need to add it to the classpath, which is a list of locations where the Java runtime can find and load classes. This article aims to explain how to add a JAR file to the classpath. We will start this explanation by introducing JAR Files. Java JAR File The full form of JAR is Java Archive File. Java provides this feature to bundle multiple Java program files as well as ... Read More

940 Views
JSP stands for Java Server Pages and is used for the purpose of developing web based applications. A single JSP page consists of HTML tags for static content and JSP tags to construct dynamic content. The JSP tags start with ‘’. We save our JSP file with the extension ‘.jsp’. The getParameter() method of JSP takes an argument and retrieves data associated with it from the source and further pass it to the destination. The source could be an HTML or JSP page and the destination could be another JSP page. Syntax request.getParameter("source"); Steps of Passing data from client ... Read More

708 Views
To get the set view of keys from a HashMap in Java, we can use the in-built method named ‘keySet()’. Here, the HashMap is a class that is used to implement Map Interface. It stores its element in key-value pairs. The Key is an object that is used to fetch and receive value associated with it. It has access to all the methods of Map Interface, it does not have any additional methods of its own. Duplicate values are not allowed, although we can store null values and keys. Java Program to Get Set View of Keys from HashMap keySet() ... Read More

3K+ Views
To get the synchronized Map from a Hash Map in Java, we can use an in-built method of Collection interface named ‘synchronized Map()’. Here, the Hash Map is a class that is used to implement Map Interface. It stores its element in key-value pairs. The Key is an object that is used to fetch and receive value associated with it. It has access to all the methods of Map Interface, it does not have any additional methods of its own. Duplicate values are not allowed, although we can store null values and keys. In this article, we will explore the ... Read More

453 Views
To get the synchronized Map from a TreeMap in Java, we can use an in-built method of Collection interface called ‘synchronizedMap()’. Here, TreeMap is a class that is used to implement NavigableMap Interface. It stores the elements of the map in a tree structure. It provides an efficient alternative to store the key-value pairs in sorted order. By default, a TreeMap is not synchronized. In this article, we will explain the need for synchronization and its practical implementation through example programs. Synchronized Map from a Tree Map A Tree Map is not thread-safe which means when we implement it in ... Read More

186 Views
ArrayList is a class of Java Collection Framework that implements List Interface. It is a linear structure that stores and accesses each object in a sequential manner. It allows the storage of duplicate values. Always remember, each class of the collection framework can hold instances of wrapper classes or custom objects. They do not work with primitives. This article aims to explain how those objects hold by an ArrayList in Java. How ArrayList holds Objects ArrayList internally uses an array to store its elements. However, the size of the array is not fixed, it can increase and decrease as per ... Read More

278 Views
In Java, concurrent programming is a technique that allows multiple tasks or processes to run simultaneously on a single processor or multiple processors. It can improve the performance and responsiveness of applications. However, it also introduces new challenges and complexities to the Java developers, such as synchronization and deadlock. In this article, we will explore some of the different approaches to concurrent programming such as multithreading and executors. Concurrent Programming in Java The following three components of Java are used for Concurrent Programming java.lang.Thread clas java.lang.Runnable java.util.concurrent Multithreading It is a feature of the Java programming language that ... Read More

1K+ Views
The most frequent query asked by beginner programmers, especially those who have already worked with C and C++ in the past, is whether Java supports pass-by-referenceor pass-by-value. Generally, programming languages use pass-by-value and pass-byreferencefor passing parameters to a method. However, Java does not support both approaches rather it uses pass-by-value to pass both primitive and reference type values. But, it provides a few ways to achieve pass-by-reference, we will explore those through this article. Ways to Achieve Paas By Reference Let’s start this discussion by understanding the storage mechanism of Java. The reference variables, names of methods and classes are ... Read More

418 Views
The Java filter() method allows us to strain elements of the stream based on the specified condition. It is a part of higher-order function that is used to apply a certain behavior on stream items. This method takes a predicate as an argument and returns a list of elements that match the predicate. But the question arises here is that how this filter() method works in the background. This article aims to explain this question through some example programs. Working of filter() method in Background Before going deep into the filter() method, let’s familiarize ourselves with I/O Streams. Itis an ... Read More