Rudradev Das

Rudradev Das

58 Articles Published

Articles by Rudradev Das

58 articles

Java Program to count inversions of size three in a given array

Rudradev Das
Rudradev Das
Updated on 23-Jan-2025 361 Views

In this article, we will learn how to count inversions of size three in a given array. The goal is to find how many triplets (i, j, k) exist such that i < j < k and arr[i] > arr[j] > arr[k].Understanding Inversion Count Inversion count is a step-counting method by which we can calculate the number of sorting steps taken by a particular array. It is also capable of counting the operation time for an array. But, if we want to sort an array in a reverse manner, the count will be the maximum number present in that array. Array: ...

Read More

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

Rudradev Das
Rudradev Das
Updated on 13-Dec-2024 4K+ 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. Just like we will check whether the string or array is 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 ...

Read More

Java Program to Represent Linear Equations in Matrix Form

Rudradev Das
Rudradev Das
Updated on 23-Nov-2024 706 Views

In this segment of Java programming, we are going to learn and discover certain programs by which we can represent linear equations in Matrix form. To do these programs, we first have to learn about linear equations and Matrix forms, their types, and how they are solved by simple mathematical methods. We will learn how to integrate a scanner class of java.util package to take input from the user using Java build code. The array will initialize to store some variables as input for the problem matrix. Then, it will be converted into a loop by which the problem equation will ...

Read More

Java program to show inherited constructor calls parent constructor by default

Rudradev Das
Rudradev Das
Updated on 18-Nov-2024 449 Views

In this article, we will learn about constructors in Java. Constructors initialize objects when they are created. We will also see how the parent constructor is called in inheritance. Problem StatementWe will demonstrate possible approaches to show how the inherited constructor calls the parent constructor by default.Different approaches The following are the different approaches to show how the inherited constructor calls the parent constructor by default− Demonstrating inheritance properties ...

Read More

Java program to set minimum and maximum heap size

Rudradev Das
Rudradev Das
Updated on 15-Oct-2024 831 Views

The Java heap is a particular memory area which is used to store the objects and represent them as or by an instance in Java Virtual Machine. The Java heap can be shared between two threads as long as the environment is occupied by some running applications. The heaps are sorted in a stack memory and follow the Last In First Out (LIFO) method after the creation of an object in JVM. When the size of the heap memory is compared to the stack, the spare objects are cleared by the GarbageCollector automatically. The heap memory is divided into three ...

Read More

Java System.nanoTime() vs System.currentTimeMillis

Rudradev Das
Rudradev Das
Updated on 07-Aug-2024 2K+ Views

What are the Time Operations in Java? There are two-time operations provided by the Java environment. For time-related operations, users can use these operations. System.nanoTime() System.currentTimeMillis() System.nanoTime() mainly known as an expensive call, is used to get a more specific value of time. And, System.currentTimeMillis() most authentic possible passed time, helps to get the time value based on the operating system. ...

Read More

Java Program to Segregate 0s on Left Side &amp; 1s on Right Side of the Array

Rudradev Das
Rudradev Das
Updated on 06-Aug-2024 2K+ Views

Segregation is a process in the field of software engineering where a code is forced to depend on those methods that are not in use. The segregation interface is known as ISP. It splits the interfaces that are vast in nature. In a Java environment, there are lots of advantages to implementing the segregation principle. It increases the readability of the particular code. It also helps to maintain that particular code conveniently. Problem Statement There is an array of 7s and 16s aimlessly. We must segregate the 7s on the left side and the 16s on the right. The basic ...

Read More

Java Program to Save a String to a File

Rudradev Das
Rudradev Das
Updated on 24-Jul-2024 3K+ Views

String, 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

Comparing Streams to Loops in Java

Rudradev Das
Rudradev Das
Updated on 18-Jun-2024 725 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. Example of Comparing Streams to Loops Here is an example − Benchmark Is Here Mode Cnt Score ...

Read More

Compiler Class In Java

Rudradev Das
Rudradev Das
Updated on 17-Jun-2024 316 Views

What is Compiler Class In Java? 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. Example of a Compiler Class in Java Here is an example for 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 ...

Read More
Showing 1–10 of 58 articles
« Prev 1 2 3 4 5 6 Next »
Advertisements