Found 9344 Articles for Object Oriented Programming

How to Create and Setup Spring Boot Project in Eclipse IDE?

Harischandra Prasad
Updated on 16-Oct-2023 12:26:38

197 Views

The Spring Boot framework incorporates all of Spring's capabilities and features because it is built upon the basis of Spring. Developers are drawn to it because of its effective production-ready environment, which frees them up to focus on the logic of the application rather than on setup and configuration. Microservices-based applications that are suitable for deployment in a production environment may be created quickly thanks to Spring Boot. Some of the key features of Spring Boot are − Auto-configuration − Spring Boot's standout feature is its auto-configuration capability. It analyzes the project's classpath and automatically configures the necessary beans ... Read More

How to Create and Modify Properties File Form Java?

Harischandra Prasad
Updated on 16-Oct-2023 12:21:50

44 Views

Program in Text and XML Format? In Java, a project's properties file is made up of text-based key-value pairs that are commonly stored with the .properties extension. The key-value pair of contents are presented line by line, and they are often created using notepad, Wordpad, etc. Properties files serve as valuable repositories for storing critical and confidential data. In this article, we will explore the process of creating a properties file using a Java program. The Properties class in this (java.util.Properties) package offers multiple utility store methods that facilitate the storage of properties in either Text Format or XML ... Read More

How to Create a TreeMap in Reverse Order in Java?

Harischandra Prasad
Updated on 16-Oct-2023 12:18:37

117 Views

In this article, we will learn how to create a TreeMap in reverse order in java. Firstly, we need to know about TreeMap. A TreeMap in Java is a class that implements the SortedMap interface, which extends the Map interface. It is a collection that stores key-value pairs and organizes them based on their natural order or a custom Comparator provided during its creation. This approach provides efficient performance for common operations such as adding, removing, and retrieving elements from the TreeMap. It has an average time complexity of O(log n), which ensures efficient execution. Syntax for Creating a TreeMap ... Read More

How to Create a Thread-Safe ConcurrentHashSet in Java?

Harischandra Prasad
Updated on 16-Oct-2023 12:14:02

125 Views

In this article, we will see what are the possibilities available to create thread-safe HashSet instances and see what will be equivalent to ConcurrentHashMap for HashSet. We will also look at the benefits and drawbacks of each approach. Before JDK8 we are not able to create a Thread Safe ConcurrentHashMap because  java.util.concurrent package in JDK8 does not provide a class named ConcurrentHashSet, two new methods were added that are discussed below. ConcurrentHashMap is the Map implementation that allows us to modify the Map while iterating. The ConcurrentHashMap operations are thread-safe. ConcurrentHashMap doesn't allow null for keys and values. Ways to ... Read More

Java Program to Find the Mth element of the Array after K left rotations

Shubham Vora
Updated on 05-Oct-2023 12:57:12

145 Views

In this problem, we will rotate the array by K left rotations and find the Mth element in the rotated array. The naïve approach to solve the problem is to rotate the array by K left rotation and take the element from the M – 1 index. The optimized approach is to find the final index value in such a way that the final index is the M – 1 index of the rotated array. Problem Statement We have given a nums[] array containing the positive integers. We have also given the positive integer K and M. We need ... Read More

Java notify() Method in Threads Synchronization with Examples

Bamdeb Ghosh
Updated on 04-Oct-2023 18:42:37

136 Views

Introduction The Object class contains a definition for the notify () method. Only one thread that is waiting for an item is wakes up by it and that thread then starts to run. A single thread can be awakened using the notify () method of the thread class. When using the notify () method while several threads are waiting for a notice, only one thread will actually get the notification and forces the others to continue waiting. Let us discuss the Java notify () method in Threads Synchronization, along with its usage and programming examples. We will look into how ... Read More

Java Multicasting (Typecasting multiple times) Puzzle

Bamdeb Ghosh
Updated on 04-Oct-2023 18:39:35

97 Views

Introduction Java Multicasting known as typecasting multiple times. It is the process of converting a value from one data type to another and it involves multiple typecasting conversions. It allows us to change the data type of a variable to perform operations that would not be possible otherwise. Let us discuss multicasting in Java. We will talk about numeric multicasting to convert between numeric data types. We will also discuss object multicasting to treat subclass objects as superclass objects. We will also provide simple programming examples to understand this topic easily. Numeric Multicasting in Java In this programming example we ... Read More

Java Method Parameters

Bamdeb Ghosh
Updated on 04-Oct-2023 18:35:39

154 Views

Introduction We know that Java Method Parameters are variables used in method declarations to accept inputs and enable the methods to work with data that are dynamic. Let us discuss the Java Method Parameters and their use in making methods reusable and adaptable. We will discuss the importance of data input, code reusability, and flexibility. We will also explain about the pass−by−value and pass−by−reference by using Java Parameters with basic programming examples. By understanding the article, we hope our readers will understand the importance of the Java Method Parameters as it helps to create essential and maintainable Java programs. Definition ... Read More

Java JSON Processing (JSON-P) with Example

Bamdeb Ghosh
Updated on 04-Oct-2023 18:14:08

107 Views

Introduction Java programs can operate with JSON data due to the strong Java JSON Processing (JSON-P) API. Web servers and clients frequently exchange data using the lightweight JSON data transfer standard. JSON-P offers the Object Model API and the Streaming API as its two primary methods for processing JSON data. Let us talk about these two strategies and use examples to show how they work and what they can do. We hope that our readers will learn about the Object Model API and Streaming API, together with Programming examples, by understanding this article's explanations on Java JSON Processing (JSON-P) with ... Read More

Update a Column in a Table using Java JDBC

Bamdeb Ghosh
Updated on 04-Oct-2023 18:04:18

182 Views

Introduction Updating a column in a database table is a relatively frequent activity in software development. Java Database Connectivity (also known as JDBC API), which serves as a link between Java programmers and databases like MySQL, may be used to carry out this task in Java. Using the JDBC API, we may establish a connection to the database, get data from tables, and carry out a number of tasks, including altering columns. We will talk about how to update a column in a table using Java JDBC. We will start by make a connection to the database and then we ... Read More

Previous 1 ... 3 4 5 6 7 ... 935 Next
Advertisements