Found 9326 Articles for Object Oriented Programming

Java Program to Search an Element in a Circular Linked List

Rudradev Das
Updated on 31-Mar-2023 15:01:43

275 Views

What are Liked List and Circular Linked List? Linked list is data structure in which every node contains two parts, a data and address path. These parts point to a next node, which always creates an interlinking with previous nodes. Based on this, a circular linked list is where the last node has an inter link with the first one, that is what these types of linked lists are known as circular linked lists. In the Java environment when we search for an element circular linked list, it is required to create a temporary node in the list to ... Read More

Java Program to Save a String to a File

Rudradev Das
Updated on 31-Mar-2023 15:00:14

1K+ Views

Strings, the series of characters, used in Java programming enable to save memory consumption and boost the performance. We can save a string to a file using Java Program can be initiated in multiple ways and has been introduced in Java version 11. Four parameters can be used to save a string to a file using Java. They are the file path, character sequence, charset, and options. File path and character sequence; these two are the most important and mandatory for this approach to write into a file. This technique encodes the characters as the content, and it returns the ... Read More

Java Program to Rotate an Image

Rudradev Das
Updated on 31-Mar-2023 14:57:24

2K+ Views

A image file can rotated clockwise or anticlockwise direction. To rotate an image it is needed to download a random image file and save it in any folder on your system. Further, a .pdf file is required to create and rotate some degrees after opening the downloaded image in that particular .pdf file. For 90 degree rotations, anchor point of a new image help us to perform the rotation operation using the translate transformation in Java. The anchor point is the center for any particular image. Algorithm to Rotate an Image by Using Java The "AffineTransformOp" class is ... Read More

Java Program To Reverse A Number And Find the Sum of its Digits Using Do-While Loop

Rudradev Das
Updated on 31-Mar-2023 14:53:26

2K+ Views

What Is A Do-While Loop? Do-while loop is a Java environment used to iterate a portion of a code in a repeat manner. The process will run in a continuous way until the specified condition becomes satisfied as a true condition. It is always recommended for a do-while loop to execute at least one when there is no fixed number of iteration mentioned. In the Java environment, the do-while loop is known as an exit control loop. At the end of a loop structure, the do-while checks the whole condition to make the condition satisfied. For this the do while ... Read More

Java Program To Reverse A Number And Check If It Is A Palindrome Number

Rudradev Das
Updated on 31-Mar-2023 17:02:17

1K+ Views

What is a Palindrome Number? If a number is given( two, three, or four-digit number) and reversing each individual number with the positions from front to back and then vice versa , and then if the number output is the same after reversing all the elements then it is said to be a palindrome number. String - A string is a storing capsule or a storing method in which we can store a sequence of characters in a Java program. Array - An array is a collection of similar type of data placed in different positions in a sequential form ... Read More

Java Program to Reverse a List

Rudradev Das
Updated on 14-Jun-2024 15:35:05

16K+ Views

What is a Reverse List? Reverse a list is an operation of swapping or interchanging the elements position into a particular list. While you are writing a code in Java, you can easily reverse the order of a certain flow. It is a conventional way of any programming language in computer science. The reverse () method is a collection of class which reverses the position of first element to last element. Last element will earn the first position itself after the termination of the process. A list is an interface where the class method is denoted as a signature with ... Read More

Java Program To Reverse A Linked List Without Manipulating Its Pointers

Rudradev Das
Updated on 31-Mar-2023 14:36:14

1K+ Views

Linked List and Pointers In Java Linked list is liner data structure in Java environment, which use to store the elements in an adjacent manner. A linked list contains with some addresses and pointers which are used to create a link between the elements present in a list. There are two types of elements present in a linked list. Those are - data element and address element. The value of an element indicated by the data part where the address part helps to create a link between the elements aka node. In Java there is an another concept of ... Read More

Java Program to Return the Largest Element in a List

Rudradev Das
Updated on 31-Mar-2023 14:31:37

2K+ Views

We can use an array loop to return back the largest element from a list. Primarily this method, known as the comparison model. The maximum number present here in a certain list will be compared with the all elements present in that particular list. The process considers “n” as a number of inputs which will store as data value in an array. After that the program will display the largest element on the output console after refining the loop. In this article today; we will help you to understand and write some Java code by which you can find the ... Read More

Java Program to return the elements at the odd position in a list

Rudradev Das
Updated on 31-Mar-2023 14:26:30

616 Views

What Is the Odd Position in A List? In a Java environment, printing a return value at odd positions of the elements can perform by a control flow statement in an array list. A control flow statement checks the odd positions on the basis of step size in Java. A loop is a condition checking control flow method that helps to evaluate whether a particular condition is true or false. For this condition, the "odd positions" always take a place as first, third, fifth manner in a particular array list. By using the syntax, the build code will check this ... Read More

Java Program to Print Summation of Numbers

Saba Hilal
Updated on 23-Mar-2023 12:42:43

591 Views

There are different ways of adding the numbers in Java. The numbers to be added can be given as input at runtime or can be put directly inside the program. However, it is difficult to add numbers in this way if the list of numbers is too big. Sometimes, the data to be added is given in an excel spreadsheet/ google sheet. So, the easy way is to save the excel spreadsheet /google sheet into a file with extension CSV (Comma Separated Values) and then CSV file’s column can be selected for adding up the values together using Java program. ... Read More

Advertisements