AmitDiwan has Published 10744 Articles

Java program to swap first and last characters of words in a sentence

AmitDiwan

AmitDiwan

Updated on 31-Jul-2024 17:51:50

3K+ Views

Problem Statement Given a sentence, create a  program in Java that swaps the first and last characters of each word efficiently as given below − Input That is a sample Output The string after swapping the last characters of every word is : thaT si a eampls Steps to swap first ... Read More

Java program to replace a word with asterisks in a sentence

AmitDiwan

AmitDiwan

Updated on 24-Jul-2024 21:48:46

3K+ Views

In this article, we will learn how to replace a specific word in a sentence with asterisks using Java. This technique can be useful for obscuring certain words in a text for privacy or censorship purposes. Problem Statement Develop a program in Java that takes a sentence and a word ... Read More

Java program to find the first non-repeating character from a stream of characters

AmitDiwan

AmitDiwan

Updated on 23-Jul-2024 18:21:33

1K+ Views

Finding the first non-repeating character in a string is a common programming problem. It involves finding the first character that appears only once in the string. This task helps understand how to manipulate strings and use basic data structures in Java. Problem Statement Given a string, identify the first character that ... Read More

How to style a header with CSS?

AmitDiwan

AmitDiwan

Updated on 23-Jul-2024 17:38:15

11K+ Views

To style a header with CSS, we can use various CSS properties to make it look attractive. In this article, we will learn and understand to style the header using diferent CSS properties. Style header with CSS We have used two h1 headings inside div ... Read More

HTML Tables with Fixed Header on Scroll in CSS

AmitDiwan

AmitDiwan

Updated on 23-Jul-2024 09:25:20

25K+ Views

We can create HTML tables with fixed header on scroll using CSS. It helps to increase readability as user doesn't have to scroll everytime to check the table header. In this article, we will learn and understand two different approaches for HTML tables with fixed header on scroll in CSS. ... Read More

How to create a signup form with HTML and CSS?

AmitDiwan

AmitDiwan

Updated on 19-Jul-2024 13:26:37

17K+ Views

In this article, we will be understanding How to create a signup form with HTML and CSS. A sign-up form allows any new user visiting the website to register. It includes adding an email-id, password, repeat password, and clicking on the Sign-Up button to register. To allow the browser to ... Read More

Java program to count the occurrences of each character

AmitDiwan

AmitDiwan

Updated on 04-Jul-2024 17:35:45

4K+ Views

In Java, counting the occurrences of each character in a string is a common task that can be efficiently performed using a HashMap. A HashMap allows us to store key-value pairs, where each unique character in the string is a key, and the value is the count of its occurrences. ... Read More

Java Program to Find Common Elements in Two ArrayList

AmitDiwan

AmitDiwan

Updated on 04-Jul-2024 16:59:09

3K+ Views

In this article, we will learn how to find common elements in two array-list. The ArrayList class extends AbstractList and implements the List interface. ArrayList supports dynamic arraysthat can grow as needed. Problem Statement In the given array, we aim to find the common elements in two ArrayList objects in ... Read More

How to create a dropdown navigation bar with CSS?

AmitDiwan

AmitDiwan

Updated on 03-Jul-2024 17:34:19

15K+ Views

Dropdown navigation is a nav bar that contain dropdown option. You will see a lot of websites where 3rd or 4th item of the navigation has the dropdown feature. When there are multiple options to render on nav bar item on the same category thats where you will need ... Read More

Java Program for Binary Insertion Sort

AmitDiwan

AmitDiwan

Updated on 02-Jul-2024 17:29:47

3K+ Views

Binary insertion sort uses the binary search to find the right position to insert an element at a specific index at every iteration. First, the location where the element needs to be inserted is found. Then, the elements are shifted to the next right location. Now, the specific element ... Read More

Advertisements