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

824 Views
In this article, we are going to use various approaches for formatting the months using different libraries of Java programming language. There are several ways to display months. Sometimes the months are written as numbers, sometimes the months are written in long form or they are written in short forms. Using java.time.Month In this approach, the months are printed by specifying the month number that starts from the number 1. For instance -> Month.of(1) will give JANUARY. Example In this Java program, we are printing all 12 months name. import java.time.Month; public class ShowMonth { ... Read More

5K+ Views
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
3K+ Views
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
613 Views
ArrayLists in Java are a dynamic array whose 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 see 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 ... Read More

2K+ Views
Natural numbers are all positive integers or whole numbers that range between 1 to infinity. In this article, we will see how to find the sum of the first N natural numbers in Java, where N is the integer up to which we need to add all the numbers starting from 1. Example Scenario: Input: num = 5 Output: sum = 15 sum = 1 + 2 + 3 + 4 + 5 Using a for loop In this approach, initialize a variable with 0 to store the sum. Then, run a for loop that goes from ... Read More
1K+ Views
In this article, we are going to see how to display Floyd’s Triangle using Java. Floyd's triangle is a popular right-angled triangular array consisting of natural numbers. 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. The first row contains only 1 number which is 1 itself and each subsequent row contains 1 more number than the previous row. The triangle has n rows where n can be any positive whole number. The total number of values in ... Read More
821 Views
In programming, functions often require parameters to be passed to them 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 understand these concepts ... Read More

3K+ Views
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

984 Views
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

844 Views
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