Samual Sam has Published 2310 Articles

Java program to get first Friday in a month

Samual Sam

Samual Sam

Updated on 29-Sep-2024 02:47:00

709 Views

In this article, we'll explore how to get the first Friday of any given month in Java. The program will use Java's LocalDate class and TemporalAdjusters to automatically calculate the first Friday based on the input date. We will walk through how this works step by step and see how ... Read More

Java program for removing n-th character from a string

Samual Sam

Samual Sam

Updated on 24-Sep-2024 21:44:16

906 Views

In this article, we will learn how to remove the n-th character from a string in Java. The program takes an input string and an index, removes the character at the given index, and returns the modified string and this process will be demonstrated through a simple example, using the ... Read More

Java program to check if two given matrices are identical

Samual Sam

Samual Sam

Updated on 20-Sep-2024 21:39:04

2K+ Views

Problem Statement Two matrices are identical if their number of rows and columns are equal and the corresponding elements are also equal. An example of this is given as follows. Input Matrix A = 1 2 3 4 5 6 7 8 9 Matrix B = 1 2 3 4 ... Read More

Java program to convert properties list into a Map

Samual Sam

Samual Sam

Updated on 19-Sep-2024 21:55:48

1K+ Views

In this article, we will learn how to convert a Properties list into a Map in Java. The Properties class is commonly used to store key-value pairs, but sometimes you may need to work with these pairs in a Map structure. We will demonstrate how to take the properties and ... Read More

Java program to display printable characters

Samual Sam

Samual Sam

Updated on 18-Sep-2024 21:56:05

973 Views

In this article, we will learn to display printable characters in Java. The program uses ASCII code from 32 to 126, which correspond to printable symbols, numbers, and letters. Instead of using System.out.println(), we will use System.out.write() to print each character. Problem Statement Write a Java program that displays all printable ... Read More

Java program to get the difference between two time zones by seconds

Samual Sam

Samual Sam

Updated on 16-Sep-2024 23:25:40

1K+ Views

In this article, we will learn to get the difference between two time zones by seconds using Java. We'll use LocalDateTime, ZoneId, and ZonedDateTime classes from java.time package to achieve this.Problem Statement Write a program in Java to get the difference between two time zones by seconds − Output Difference ... Read More

Java program to add 3 months to the calendar

Samual Sam

Samual Sam

Updated on 16-Sep-2024 23:25:26

1K+ Views

In this article, we will learn to add 3 months to the calendar. We will take the current date and add 3 months to it using Calendar class in Java. You’ll see how to handle date manipulation and update the date accordingly. Problem Statement Write a program in Java to ... Read More

Java program to change JLabel text after creation

Samual Sam

Samual Sam

Updated on 16-Sep-2024 23:24:47

3K+ Views

In this article, we will learn to change JLabel text after creation in Java. We'll cover two scenarios: changing the label text immediately after creation and updating it in response to a button click. Different approaches to change JLabel text after creation Below are the different approaches to change JLabel text after ... Read More

Convert text to lowercase with CSS

Samual Sam

Samual Sam

Updated on 11-Sep-2024 14:40:50

4K+ Views

To convert text to lowercase with CSS, we will be using the lowercase value of text-transform property. Example In this example, we are using text-transform property and displaying the result as before and after the conversion using p tag. ... Read More

Java program to subtract 1 year from the calendar

Samual Sam

Samual Sam

Updated on 05-Sep-2024 11:21:31

2K+ Views

In this article, we will subtract one year from the calendar in Java. We will be using Calender class from the java.util package. The program captures the current date, subtracts one year from it, and then displays the updated date. Problem Statement Write a Java program to subtract one year ... Read More

Previous 1 ... 3 4 5 6 7 ... 231 Next
Advertisements