Found 35163 Articles for Programming

Compiler Class In Java

Rudradev Das
Updated on 29-Dec-2023 16:14:29

83 Views

A native code is a coding formation that can be run in a Java Virtual Machine. The compiler class, provides a support as well as give us a space to convert a Java code to a native code. This a public package which embedded in java.lang.Compiler.command() package in a Java environment. Here is an example fo a compiler class in Java − class of the NewClass$CompilerClass Name Value Is: null value Is the compilation successful here? : false value Is the compilation successful using str here? : false value Algorithm to Operate With a Compiler Class in Java ... Read More

Compile Time Polymorphism in Java

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

93 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

201 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

71 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

36 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

80 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

67 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

Given two numbers as strings, find if one is a power of other

Rudradev Das
Updated on 27-Dec-2023 17:26:59

106 Views

Assume we have a data set of some numbers as a string and denoted as str[]. Now the task is to multiply the two large numbers which represents a string here. We need to find out from those two numbers as strings, find if one is a power of other. Here is a general example of the process − Input for the process us: a = "374747", b = "52627712618930723" Output : YES THE VALUE IS HERE Explanation of the process: 374747^3 = 52627712618930723 Input for the process is : a = "2", b = "4099" Output : NO ... Read More

Palindrome by swapping only one character

Rudradev Das
Updated on 27-Dec-2023 17:23:08

62 Views

In a C++ environment, the palindrome is a process where a set or string remains same from the intial stage of the process to termination of that same particular process. Assume, we have a string denoted as the str[]. And the task is to check the string will be paindrome or not after performing the swapping process with only one character for once. Here is a general example of the swapping process − Input : ARBRDD Output : true Explanation: Swap the value A(1st index present in the list) with the R. Input : INDBAN Output : true Explanation: ... Read More

Print reverse string after removing vowels

Rudradev Das
Updated on 27-Dec-2023 17:18:14

70 Views

The reverse() is a pre-installed and predefined header file, which is used to define as a template in a process in a C++ environment. The method is able to reverse the elements from last to first manner in a range for any value container. For this process the time complexity is O(n). Lets assume, we have a string or a sentance declared as str[] with some data elements and now the task is to perform reverse process after removing the vowels from that string to get the final outcome. Here is some general examples of the process method − ... Read More

Advertisements