Programming Articles

Page 153 of 2544

Java Program to Print Upper Star Triangle Pattern

Alshifa Hasnain
Alshifa Hasnain
Updated on 07-Jan-2025 1K+ Views

In this article, we will learn to print the upper star triangle pattern in Java. Printing patterns is a common exercise to strengthen the understanding of loops in programming. One of the most popular patterns is the Upper Star Triangle, which visually resembles an inverted right-angled triangle of stars aligned from the top. Below is a demonstration of the same − Input Enter the number of rows : 8 Output The upper star triangle star pattern : * ...

Read More

Java Program to convert integer to String with Map

Alshifa Hasnain
Alshifa Hasnain
Updated on 07-Jan-2025 825 Views

In this article, we will learn to convert integers to String with Map in Java. The Stream API has become an essential tool for processing collections of data in a more declarative and readable way. Instead of using traditional loops, streams allow developers to filter, map, and perform other operations on data with minimal code Problem Statement Given an integer, we need to convert it to its string representation where the integer is treated as a character (e.g., 5 becomes "5", 10 becomes "10"). We'll use a Map to define the integer-to-string mappings and retrieve the string equivalent for a ...

Read More

Java Program for Reversal algorithm for right rotation of an array

Shriansh Kumar
Shriansh Kumar
Updated on 07-Jan-2025 394 Views

An array is a linear data structure that stores a group of elements with similar datatypes, in a sequential order. Once we create an array, we can’t change its size, i.e., it can store a fixed number of elements. In this article, we will learn how to write a Java program where we create an array and perform the right rotation using the reversal algorithm. Right Rotation of an Array Let’s understand the term right rotation in the context of an array. In the right rotation of an array, we simply shift the elements of the array to our right till the specified number ...

Read More

What are the modules available in Python for converting PDF to text?

SaiKrishna Tavva
SaiKrishna Tavva
Updated on 07-Jan-2025 457 Views

Python offers several powerful libraries to convert PDF documents to plain text, such as PyPDF2 and PDFMiner which are two popular modules for text extraction from PDFs. Some of the common approaches (modules) for converting PDF to text are as follows- Using PyPDF2 Using PDFMiner Using PyMuPDF Using 'PyPDF2' Module PyPDF2 is a versatile library used for manipulating PDF files, focusing on functions such as merging, splitting, rotating pages, and extracting text. It offers a simple approach for performing basic PDF operations. To extract data using ...

Read More

What is difference between raw_input() and input() functions in Python?

Akshitha Mote
Akshitha Mote
Updated on 07-Jan-2025 824 Views

Developers have to interact with users to get data or provide some sort of result. These days, most programs use a dialog box to give some type of input. In Python, there are two in-built functions to read the input from the user − input() raw_input() Python input() Function In Python, the input() is a user-defined function used to take the values from the user. Whenever we use this function the program will stop till the user provides an input value. There is a slight ...

Read More

What do you mean by odd loops in C language?

Bhanu Priya
Bhanu Priya
Updated on 07-Jan-2025 3K+ Views

In C programming language, control statements are used to repeat a set of statements, while conditional statements are used for decision-making. These decision-making statements are also used to determine one or more conditions that decides whether a set of statements should be executed. They are as follows − for loop while loop do-while loop For loop and while loop, the condition specifies the number of times the loop can be executed. The "for loop" The for loop is an entry-controlled loop that executes statements until the ...

Read More

Java Integer compare() method

Alshifa Hasnain
Alshifa Hasnain
Updated on 06-Jan-2025 3K+ Views

Integer compare() Method The compare() method in the Integer class is a part of the Java interface and is used to compare two integers. It provides a way to compare two Integer objects or primitive int values and determine their relative ordering. This method is particularly useful when sorting or working with collections that involve integer values. Syntax public static int compare(int x, int y);Where − x: The first integer to be compared. y: The second integer to be compared. Return Value The compare() method returns an integer value that ...

Read More

Java DatabaseMetaData getMaxBinaryLiteralLength() method with example.

Smita Kapse
Smita Kapse
Updated on 02-Jan-2025 185 Views

In this article, we will learn about the getMaxBinaryLiteralLength() method of the DatabaseMetaData interface in JDBC.  getMaxBinaryLiteralLength() method The getMaxBinaryLiteralLength() method of the DatabaseMetaData interface is used to find out the maximum number of characters (hex) that the underlying database allows for a binary literal. This method returns an integer value, representing the maximum length of a binary literal. If this value is 0 it indicates that there is no limit or, the limit is unknown. Steps to get the DatabaseMetaData object The following are the steps to get the DatabaseMetaData object − ...

Read More

Java DatabaseMetaData getDatabaseMinorVersion() method with example

Rishi Raj
Rishi Raj
Updated on 02-Jan-2025 172 Views

In this article, we will learn how to use the getDatabaseMinorVersion() method of the DatabaseMetaData interface in Java to retrieve the minor version of the underlying database. This method helps check the version details of the connected database. What is DatabaseMetaData?The DatabaseMetaData is an interface that provides methods to retrieve metadata about a database, such as the database product name, version, driver name, the total number of tables, views, and more. To get the DatabaseMetaData object, use the getMetaData() method of the Connection interface.Syntax: public DatabaseMetaData getMetaData() throws SQLException; ...

Read More

Java Program to display Frame after some seconds

karthikeya Boyini
karthikeya Boyini
Updated on 02-Jan-2025 501 Views

In this article, we will learn how to display a frame after a few seconds in Java using the Timer class. This example shows how to delay the visibility of a frame by 2 seconds using Swing. Timer() class The Timer class is used to schedule tasks that execute after a specific time interval or repeatedly at regular intervals. It allows tasks to be run by a thread that handles the scheduling and execution. Each task can be set to execute either once or repeatedly at fixed intervals. The execution of all tasks is managed by a background thread associated ...

Read More
Showing 1521–1530 of 25,433 articles
« Prev 1 151 152 153 154 155 2544 Next »
Advertisements