Found 9321 Articles for Object Oriented Programming

Find All Possible Coordinates of a Parallelogram in Java?

Mr. Satyabrata
Updated on 01-Mar-2023 11:40:21

155 Views

A parallelogram refers to the quadrilateral which has two pairs of parallel sides where opposite sides are equal in length, and the opposite angles are equal in measure. In this article we are going to find all possible coordinates of a Parallelogram. Basically, we will find all the possible coordinates from the given three coordinates to make a parallelogram of a non-zero area. Here the three given coordinates are not fixed points and can change. Therefore, if three coordinates are given, we may claim that there are only three coordinates from which we can build a parallelogram. As per ... Read More

Convert All Lowercase Text of a File into Uppercase in Java?

Mr. Satyabrata
Updated on 01-Mar-2023 11:31:16

3K+ Views

In this article we are going to change all lower-case text to upper-case text in a file in java. Suppose the text file contains the following data − “Merry and Jack are studying.” Then after updating the text file with specific value the result will be − “MERRY AND JACK ARE STUDYING.” This modification is done with the help of toUpperCase() Method. It belongs to the String class in java. Let’s deep dive into this article, to know how it can be done by using Java programming language. To show you some instances Instance-1 Suppose the original content of the ... Read More

Why can’t a Priority Queue wrap around like an ordinary Queue?

Sonal Meenu Singh
Updated on 22-Feb-2023 16:09:59

240 Views

Introduction A queue is an abstract Data type that inserts elements from the Rear end and removes them from the Front end. There are three types of queues: Simple Queue, Priority Queue, and Circular Queue. In this tutorial, we understand why we cannot wrap around a Priority queue and the reasons for it. Priority Queue It is a unique queue that is not based on the FIFO principle for Queue operations. What makes it unique? It is the priority of its elements for removing or deQueue. Each element of the priority queue has some priority and they are removed based ... Read More

Time and Space Complexity Analysis of Queue operations

Sonal Meenu Singh
Updated on 22-Feb-2023 15:51:25

2K+ Views

Introduction Queue is a linear data structure that uses the FIFO approach for inserting and removing its elements. It can be implemented by using arrays and linked lists. In this tutorial, we will analyze the time and space complexity of array based queue for its different operation. Queue Implementation Using Array The principle of Queue is its FIFO approach and it states that the element that enters first in the Queue will be the first to be removed from it. Its elements are inserted at the Rear end. Queue elements are removed from the Front end. The real-life example of ... Read More

Should we declare it as Queue or Priority Queue while using Priority Queue in Java?

Sonal Meenu Singh
Updated on 22-Feb-2023 15:37:35

161 Views

Introduction The queue is a linear data structure that follows the FIFO approach to insert and extract its data. A priority Queue is a structured Queue, where all data have some priorities for their processing. In Java, a queue or priority queue is an interface. In this tutorial, we will examine whether we should declare a queue or priority queue as a Priority Queue in Java. Queue A Queue in Java is an interface and that interface belongs to java.util package. The queue interface extends the Collection Interface and this interface has several methods. Queue uses FIFO (First In First ... Read More

How to implement size-limited Queue that holds last N elements in Java?

Sonal Meenu Singh
Updated on 22-Feb-2023 11:58:17

823 Views

Introduction A queue is an interface in Java. It is used to insert elements at one end and remove them from another end. It uses the FIFO principle for its processing. The queue extends the Collection framework and is defined in the Java.util interface. In this tutorial, we will understand the implementation of size limited queue in Java. What is Size Limited Queue in Java? A size-limited queue is a queue with a fixed size of N. It cannot hold elements more than its size. If you try to push more data, it will remove elements from its front ... Read More

Get requests using AJAX by making a Custom HTTP library

Shubham Vora
Updated on 16-Feb-2023 15:35:28

172 Views

We will learn to make a get request using the AJAX by making the custom HTTP library. Let’s learn about the Get request and AJAX before we start with the tutorial. The Get request is used to get or fetch data from the API (Application programming interface). The AJAX stands for Asynchronous JavaScript and XML. The AJAX allows us to load or update new data without reloading the webpage. For example, if you have ever worked with ReactJs, it updates the data without reloading the webpage. If we reload the webpage whenever data updates, it can give a bad user ... Read More

Bit Stuffing error detection technique using Java

Satish Kumar
Updated on 08-Feb-2023 21:12:56

850 Views

Bit stuffing is a technique used in data communication systems to detect and correct errors that may occur during the transmission of data. It works by adding extra bits to the data being transmitted in order to flag when an error has occurred. One common way to implement bit stuffing in Java is to use a flag byte (such as 0x7E) to indicate the start and end of a frame, and to use a special escape byte (such as 0x7D) to indicate that the next byte is a stuffed bit. For example, the sender would add a stuffed bit before ... Read More

How to cancel XMLHttpRequest in AJAX?

AmitDiwan
Updated on 06-Feb-2023 12:42:20

1K+ Views

We will use the "abort()" method to cancel the XMLHttpRequest. This will stop the current request from continuing to execute. In the future, we will make sure to properly cancel any requests that are no longer needed to optimize performance. Let us first understand what XML HttpRequest is. XMLHttpRequest is a JavaScript object that allows web developers to make HTTP requests to a server without reloading the entire page. It is often used for creating dynamic and interactive web applications. The API can be used to retrieve data in different formats such as text, XML, and JSON. XMLHttpRequest is supported ... Read More

Why Spring Boot the King of Java Frameworks?

Mr. Satyabrata
Updated on 03-Feb-2023 23:18:55

546 Views

Java developers have a wide array of frameworks to choose from when building web applications, but one stands out above the rest: Spring Boot. This framework has become increasingly popular in recent years due to its ease of use, flexibility, and powerful features.  Unleashing the Magic of Spring Boot in Development! As a developer, it's easy to feel bogged down by the monotony of repetitive tasks and endless configurations. But with Spring Boot, gone are the days of tedious setup and overwhelming decisions. This revolutionary framework takes the hassle out of development, allowing you to focus on the exciting parts ... Read More

Advertisements