Found 9624 Articles for Object Oriented Programming

Eclipse fails to start via an Application Launcher

Satish Kumar
Updated on 14-Mar-2023 16:09:40
Eclipse is one of most popular Integrated Development Environment (IDE) used by millions of developers around world. It provides a comprehensive set of tools and features for developing Java applications, web applications, and other software projects. However, like any software, Eclipse may encounter issues and errors that can prevent it from starting up via an application launcher. In this article, we will discuss some common causes of Eclipse startup failure and how to troubleshoot them. Possible Causes of Eclipse Startup Failure Corrupted Installation One of most common reasons why Eclipse fails to start is a corrupted installation. This could be ... Read More

Java Program to Encode a Message Using Playfair Cipher

Pranay Arora
Updated on 10-Mar-2023 11:31:25
Encrypting is the task of transforming information into an unreadable format or cipher text. It is usually done to protect the confidentiality of information. There are many ways and algorithms to encrypt data. One such example is the Playfair cipher algorithm. In this article, we are going to see how to write a Java program to encode a message using Playfair cipher. Playfair cipher makes use of a 5X5 grid or matrix and a set of pre-defined rules. To encrypt, we require a key and the plain text to be encrypted. Steps Now let us see the steps to encrypt ... Read More

Java Program to Empty an ArrayList in Java

Pranay Arora
Updated on 10-Mar-2023 11:25:18
ArrayLists in Java are a dynamic array who’s size can grow or shrink as elements are added or deleted from it. It is a part of the “java.util” package and is a very commonly used collection. An ArrayList is pretty much like an array as it stores elements of the same or homogeneous type in a contiguous block of memory. In this article, we are going to se the different ways to empty an ArrayList in Java. There are mainly 4 approaches to empty an ArrayList in Java and are as follows − Using the Naïve method Using the ... Read More

Java Program to Display Numbers and Sum of First N Natural Numbers

Pranay Arora
Updated on 10-Mar-2023 11:22:28
Natural numbers are all positive integers or whole numbers that range between 1 to infinity. In this article, we are going to see how to display numbers as well as the sum of the first N natural numbers in java where n is defined by the user. Mathematically speaking, the sum of 1st N natural numbers is given by the formula − Sum = n * (n+1) / 2 In order to implement this in java, there are mainly 3 methods with a slight difference. 1. Using a for loop or do while loop or while loop The approach here ... Read More

Java Program to Display Floyd's Triangle

Pranay Arora
Updated on 10-Mar-2023 11:20:42
Floyd's triangle is a popular right-angled triangular array consisting of natural numbers. The name comes from its founder Robert W. Floyd who was a prominent computer scientist. It is formed by starting with the number 1 at the top of the triangle, and then incrementing each subsequent number by 1 as you move down the rows of the triangle. In this article, we are going to see how to display Floyd’s Triangle with the help of a Java program. But before going forward with the Java implementation, let us understand Floyd’s triangle a little more. The first row ... Read More

Java Program to Demonstrate the Call By Value

Pranay Arora
Updated on 10-Mar-2023 11:16:53
In programming, functions often require parameters to be passed to them in order to be called or invoked. There are 2 ways to call functions, the 1st being call by Reference and the 2nd being call by value. In this article, we are going to demonstrate call by value in java. Call by value is a method in which the value of the argument is passed as a copy to the function, hence any change made to this argument inside the function will not affect the original value of the argument beyond the scope of this function. To help ... Read More

How to send button value to PHP backend via POST using ajax?

Mohit Panchasara
Updated on 10-Mar-2023 16:56:27
AJAX (Asynchronous JavaScript and XML) makes web pages more responsive, interactive, and dynamic by enabling server communication without requiring a page to load. JavaScript is used to send and receive data from a server using various technologies, including XML, JSON, and HTML. In these, JSON is the most popular. AJAX is frequently used to transmit information from a web page to a server-side script, like a PHP script. The XMLHttpRequest object, included in most contemporary web browsers, can be used for this. You can establish a connection to a given URL, send data to that URL, and then wait ... Read More

Rotate the matrix 180 degree in Java?

Mr. Satyabrata
Updated on 09-Mar-2023 12:13:59
In Java, Array is an object. It is a non-primitive data type which stores values of similar data type. The matrix in java is nothing but a multi-dimensional array which represents multiple rows and columns. As per the problem statement we have to rotate the given matrix to 180 degrees. It means we have to interchange the rows of the given matrix in symmetric- vertically. 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 matrix is { {10, 20, ... Read More

Replace the Matrix Elements by Its Square in Java?

Mr. Satyabrata
Updated on 09-Mar-2023 12:07:03
Matrices are nothing but it’s more than a collection of data elements arranged in a rectangular layout that is two-dimensional. In Java, an array with two dimensions can be considered as a matrix. As per the problem statement the task is replace the matrix elements by its square. 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 matrix is {{8, 3, 2}, {12, 7, 9}, {6, 4, 10}}; After replacing the matrix element by its square, the result matrix will be 64 ... Read More

How to Homogenize a Point in Java?

Mr. Satyabrata
Updated on 09-Mar-2023 11:59:15
In this article we will see how to homogenize a point. Any point in the projective plane is represented by a triple (X, Y, Z), called homogeneous coordinates or projective coordinates of the point, where X, Y and Z are not all 0. The point represented by a given set of homogeneous coordinates is unchanged if the coordinates are multiplied by a common factor. As per the problem statement we have to homogenize a point by taking any common factor and multiplying it with the given points. Let’s start! To show you some instances Instance-1 Suppose the points are (10, ... Read More
1 2 3 4 5 ... 963 Next
Advertisements