Articles on Trending Technologies

Technical articles with clear explanations and examples

Tutorix - AI Tutor

C++ Program to Print Hollow Square Pattern

C++
AYUSH MISHRA
AYUSH MISHRA
Updated on 23-Jan-2025 20K+ Views

When we start learning to code, practicing star patterns is one of the best ways to improve logic building. One of the simplest yet fascinating patterns is the hollow square pattern. In this article, we are going to learn how to print a Hollow Square Pattern using C++. What is Hollow Square Pattern? A hollow square pattern is a geometrical arrangement of stars forming a square shape, but the stars are present only at the boundary of the square. The stars are printed in such a manner that the edges of the square are filled with stars, while the interior ...

Read More

Java program for longest subsequence of a number having same left and right rotation

Shubham Vora
Shubham Vora
Updated on 23-Jan-2025 357 Views

In this tutorial, we will learn how to find the maximum length of the subsequence having the same left and right rotations in Java. We find the maximum length of such subsequence. Finding the longest subsequence with identical or alternating digits We will solve the problem based on a particular observation. The strings can only have the same left and right rotations if all digits of strings are equal or it contains the two digits alternatively, and the string length is even. Step 1: Initialize Variables: Initialize the len variable with the string length and ...

Read More

Java Program for Arithmetic Operations Between BigDecimal and Primitive Data Types

Mr. Satyabrata
Mr. Satyabrata
Updated on 23-Jan-2025 524 Views

In this article, we will explore how to perform arithmetic operations between BigDecimal and Primitive data types by using Java. For instance, Addition: The sum of a BigDecimal object with a value of 10.50 and an int primitive with a value of 5 is a BigDecimal object with a value of 15.50. 10.50 + 5 = 15.50 SyntaxThe syntax doubleValue() method returns the value of a BigDecimal object as a double primitive type. double doubleNum1 = num1.doubleValue(); Where “num1” is a BigDecimal object. What is BigDecimal in Java? BigDecimal is a class in Java's java.math package that ...

Read More

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

Rudradev Das
Rudradev Das
Updated on 23-Jan-2025 420 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 Convert the ArrayList into a String and Vice Versa

AmitDiwan
AmitDiwan
Updated on 23-Jan-2025 601 Views

In this article, we will understand how to convert the ArrayList into a string and vice versa. The ArrayList class is a resizable array, which can be found in the java. util package. The difference between a built-in array and an ArrayList in Java is that the size of an array cannot be modified. ArrayList definitionAn ArrayList in Java is a resizable array found in the java.util package, which allows for dynamic modifications in size as elements are added or removed. It supports ...

Read More

Java DatabaseMetaData getTimeDateFunctions() method with example

Vikyath Ram
Vikyath Ram
Updated on 23-Jan-2025 181 Views

In this article, we will learn how to retrieve the list of time and date functions in the database using the getTimeDateFunctions() method of the DatabaseMetaData class in Java. getTimeDateFunctions() The getTimeDateFunctions() method retrieves the list of time and date functions supported by the current database. The names returned by this method are the Open CLI time and date function names. Steps to Retrieve Time and Date Functions in Database To get the list of the time and date functions supported by the underlying database − Step 1: Register the Driver: Make sure your database is ...

Read More

Java sql.Time setTime() method with example

Vikyath Ram
Vikyath Ram
Updated on 23-Jan-2025 819 Views

In this article, we will learn the usage of the setTime() method in Java with a complete example. Handling time-related data is an essential aspect of many Java applications, especially when interacting with databases. The java.sql.Time class, designed to handle SQL TIME values. What is setTime() method The setTime() method of the java.util.Time class accepts a variable of long type, representing the number of milliseconds from the epoch time (January 1, 1970, 00:00:00.000 GMT) to the required time, and sets the specified time value to the current Time object. //Setting time time.setTime(time_value_in_long); Use Cases of setTime() Following are the use ...

Read More

How do we use re.finditer() method in Python regular expression?

SaiKrishna Tavva
SaiKrishna Tavva
Updated on 23-Jan-2025 19K+ Views

The re.finditer() method in Python's 're' module finds all occurrences of a specified pattern in a string. It returns an iterator containing match objects for each occurrence. This method is especially useful when you need to determine the position of each match within the input string. Following is the syntax for re.finditer() method. re.finditer(pattern,  string,  flags=0) How to Use 're.finditer()' Method Following are the steps involved in using re.finditer() method. Import the re module: You need to import the regular expression module before using it. ...

Read More

Difference Between Weebly vs Magento

Harleen Kaur
Harleen Kaur
Updated on 23-Jan-2025 2K+ Views

Many industries are switching from traditional to digital marketing as a result of technological advancements. Every business, no matter how big or little, wants to be online, which is why several companies have developed content management and website building platforms that make it simple to develop web apps. Weebly and Magento are two such platforms that offer various services for creating websites and online applications for either personal or business use. What is Weebly? Weebly is a website development firm that assists in creating e-commerce websites and interactive web applications. This platform was developed by Chris Fannin, Dan Veltri, and ...

Read More

Java Program to Sort ArrayList of Custom Objects by Property

Alshifa Hasnain
Alshifa Hasnain
Updated on 22-Jan-2025 846 Views

In this article, we will learn to sort ArrayList of custom objects by property in Java. The ArrayList class extends AbstractList and implements the List interface. ArrayList supports dynamic arrays that can grow as needed. Problem Statement ArrayList is created with an initial size. When this size is exceeded, the collection is automatically enlarged. When objects are removed, the array may be shrunk. Below is a demonstration of the same − Input − The list is defined as Java Scala Python Mysql Output  − The list after sorting values: Java Mysql Python Scala ...

Read More
Showing 31411–31420 of 61,298 articles
Advertisements