Found 9344 Articles for Object Oriented Programming

Compile Time Polymorphism in Java

Rudradev Das
Updated on 29-Dec-2023 15:49:04

77 Views

The polymorphism is a declaration of an object capacity present in a Java environment. It allows us to perform the same process in different manner. There are two types of polymorphism present in Java − Compile-time polymorphism method Run time polymorphism method Today, we are going to discuss about the compile time polymorphism by using the Method overloading and Operator overloading. Here is an example − void ARBRDD() { ... } void ARBRDD(int num1 ) { ... } void ARBRDD(float num1) { ... } void ARBRDD(int num1 , float num2 ) { ... } show the value of ( char a ) show the value of ( char a ,char b ) show the ... Read More

Comparing Two ArrayList In Java

Rudradev Das
Updated on 27-Dec-2023 16:57:33

158 Views

There are various methods available, to compare the two particular array lists by using a Java environment. It consists of the array lists, as they are same in the size and should contain with the same elements in that particular lists. Here are some process mentioned below − Java equals() method Java removeAll() method Java retainAll() method Java ArrayList.contains() method Java contentEquals() method java.util.ArrayList method For this process − This particular function has a single parameter value to be compared for the equality. The process will return a true pop up if the array lists are equal. ... Read More

Comparing Streams to Loops in Java

Rudradev Das
Updated on 27-Dec-2023 18:07:57

61 Views

Stream is a pipeline system, which is mainly used to aggregate some operations like (filter(), map(), forEach(), and collect()) in a Java environment. This function consists of a source which is followed by the value of zero and then terminate the operation. A function is an input output stream whis mainly depends on the input arguments. Every stream works when − It starts from a data source. Process the data elements through a pipeline. Terminates itself in a terminal operation. Here is an example − Benchmark Is Here Mode Cnt Score Error Units ForLoopPerformanceTest.usingForEachLoop thrpt 20 259.008 ... Read More

Commonly Used Methods in LocalDate, LocalTime and LocalDateTime Classes in Java

Rudradev Das
Updated on 27-Dec-2023 17:57:41

34 Views

There are three types of most important classes we can find in a Java environment, related to date and time. LocalDate, LocalTime and LocalDateTime are available in the Java programming to handle the operations related with the date and time problems. Here we need to import the Java package as java.time which is a main application programming interface aka API for date, time, instants, and the time durations. Purpose of the LocalDate, LocalTime and LocalDateTime classes are − java.time.* //It is the process to include all classes java.time.LocalDate //It is the process for LocalDate java.time.LocalDateTime //It is the process ... Read More

Collections.sort() in Java with Examples

Rudradev Das
Updated on 27-Dec-2023 17:45:36

53 Views

The collection class is an enhanced static method to sort the elements from a particular collection of a list or an array. For this process, we can use a tree set also, when we operate on a set of elements as present as the raw set type primarily. The Collections.sort() method is present in the java.util.Collections class, and enables the user to sort the elements from a specific list in an ascending order. The method is an upgraded version of the java.util.Arrays.sort() method class, which is capable to sort the elements from a linked list as well as queue and ... Read More

Collections.reverseOrder() in Java with Examples

Rudradev Das
Updated on 27-Dec-2023 17:43:20

60 Views

Collections reverse order class is a reverse order method, which is encoded in the collections class. It is present in the java.util package. It returns a comparator as a result, which is a predefined comparator in nature. By using this comparator package, we can rearrange the collections of a particular data set in a reverse manner. There are two different variants of the Java reverseOrder(), which can be defined as per the capacity of their parameters. Those are − Java Collections reverseOrder() Method − is used to get the value of a comparator class which can impose the reverse ... Read More

Java program to iterate over arrays using for and foreach loop

Shubhi Rastogi
Updated on 21-Nov-2023 17:59:22

335 Views

In the article, the users will learn how to iterate the arrays for each loop and for loop with the examples. Create an array with the data that have any type of the data like numeric or statement form in the array. Let’s announce any string array known as designations, and initialize the array with the items as input like this. Then the users have to iterate this array with the loops and print each element. for(String designation: designations){} The users affirm a loop variable. The users have been given a string array because each element is a string In this array so ... Read More

Java program to merge two arrays

Shubhi Rastogi
Updated on 21-Nov-2023 17:53:28

265 Views

In the article, the users are going to merge two arrays. The users create any type of two arrays as input like arr1[] and arr2[] with the examples. The users have to create the two types of arrays with multiple elements as the inputs and it presents the result with different elements as the output. Print all of the elements of the array in the sorted sequence in Java programming language. Two approaches are illustrated in this article. The first approach uses the concept of the arrays whereas the second approach represents the Map function to merge to arrays. The ... Read More

How to Run Your First Spring Boot Application in Spring Tool Suite?

Adeeba Khan
Updated on 20-Oct-2023 16:35:50

301 Views

Spring boot facilitate the simple way to create robust, scalable, as well as production-ready applications, by doing this they have revolutionized the development of Java applications. The "convention over configuration" philosophy, which is embraced by Spring Boot as a component of the larger Spring ecosystem, lessens the effort of manual setup and enables developers to concentrate on business logic rather than boilerplate code. The Spring Boot experience is considerably more effective when combined with Spring Tool Suite (STS), a specialized IDE created for Spring development. To execute this code in Spring Tool Suite one must ensure that they have the following prerequisites before we ... Read More

How to Run Your First Spring Boot Application in IntelliJ?

Adeeba Khan
Updated on 20-Oct-2023 16:36:47

133 Views

IntelliJ is simple and very convenient to use in building reliable as well as scalable systems with Spring Boot, and it has become tremendously famous among Java developers. It also offers a convention-over-configuration approach by obviating the demand for bulky boilerplate code and enabling designers to concentrate on business logic. This potent web tool aims in generating a basic project structure with the necessary dependencies. The second method focuses on importing a pre-existing Spring Boot project into IntelliJ IDEA so that one can work on an existing codebase. To execute this code in IntelliJ one must ensure that they have ... Read More

Advertisements