Found 2616 Articles for Java

Java Program to Reverse a List

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

17K+ 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

635 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

6 JavaScript Optimization Tips from Google

Biswaindu Parida
Updated on 31-Mar-2023 09:25:57

162 Views

Overview to Java Optimization Java is a popular programming language for developing mobile apps to enterprise-level software systems. However, as the size and complexity of Java applications increase, so does the potential for performance issues. Java optimization identifies and addresses performance bottlenecks in Java applications to ensure they run efficiently and meet the desired performance requirements.  In this article, we will explore the importance of Java optimization and provide an overview of key techniques and best practices for optimizing Java code. We will also discuss common performance issues, how to address them, and the tools and resources available to ... Read More

Java Program to Print Summation of Numbers

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

601 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

Java Program to Open the given URL in System Default Browser in Windows

Saba Hilal
Updated on 23-Mar-2023 12:37:46

4K+ Views

There are different ways of viewing web pages in a browser using URL. Here, the methods of doing the same are specified using the Java code. The given URL is first entered by using the Java program. Then the related Webpage is opened in the default browser. This article uses three different approaches for opening the webpage as specified by the URL in the browser through the Java code. Multiple Approaches For these programs, the displaying of the given URL is done using two different approaches. By Using desktop.browse(uri) for the object belonging to Desktop class. By Using javafx ... Read More

Java Program to Print Swastika By Taking Input from User

Saba Hilal
Updated on 23-Mar-2023 12:34:37

683 Views

Here, two different approaches are used for making this design using Java. In both approaches, the size of the Swastika is decided by the user. The user provides the input for the table or frame size. The Swastika is often used as an example to learn rows, column and tabular layout concepts using different languages including java. Swastika is a religious symbol of Hinduism, Buddhism and Jainism. Making Swastika using Java. Here, three different approaches are used for making this design using Java. Multiple Approaches The given problem would be solved by three distinct approaches. By using two ... Read More

Java Program to open the Command Prompt and Insert commands

Saba Hilal
Updated on 24-Jun-2024 15:53:26

5K+ Views

This article uses various approaches for selecting the commands inserted in the opened command window through the Java code. The command window is opened by using ‘cmd’. Here, the methods of doing the same are specified using Java code. The Command window is first opened using the Java program. It is opened as a child process. If the java program is run in an existing cmd window, another one is opened as a new process. Further, different types of commands are inserted and executed in that opened command window via the java code. These programs may not work in ... Read More

Java Program to Read a Large Text File Line By Line

Saba Hilal
Updated on 23-Mar-2023 12:06:38

464 Views

This article includes the way to read text files line by line. Here, the three different methods are explained with examples. Storing a file in text format is important especially when data from one structured /unstructured form is transferred to another form. Therefore, basic file transfer systems integrate the txt file reading and writing process as their application components. Therefore, how to use text file reading and writing methods is also important for making the parsers. Multiple Approaches The given problem statement is solved in three different approaches By using the BufferedReader class By using the FileInputStream By using ... Read More

Advertisements