Posts related to tag: Java


Java- Return the Squares of a Sorted Array in Sorted Order

In this Java exercise, you have an integer array sorted in non-decreasing order, and you must return an array of […] Continue reading »

Java- Convert a Degree to Clock Time

Write a Java program to convert a degree to the clock time with hour: minute format. Assume if… Degree 0 […] Continue reading »

How to schedule a Task in Java

In Java to run/execute a task periodically or at some interval, we can use the TimerTask class from its java.util […] Continue reading »

Java- Print all duplicate elements from a List

In Java, we have multiple ways to find duplicate elements in a List. We can loop through the List and […] Continue reading »

Find second index of a substring in a String in Java

In Java, we can use the overloaded method indexOf(String str, int fromIndex) of the String class to get the second […] Continue reading »

Java- Count number of pairs in the Array whose sum is zero

This Java example will help to solve a given scenario. Scenario: Write down a Java program that calculates the number […] Continue reading »

Difference between trim() and strip() methods in Java

In this article, you will learn the difference between trim() and strip() methods of the String class in Java. trim() […] Continue reading »

Java – isBlank() vs isEmpty() method of String class

In this short article, you will get to know about the difference between the isBlank() and isEmpty() methods of the […] Continue reading »

Java – Capitalize the first letter of a String

In this short tutorial, you will get an idea of how to capitalize the first letter of a string. In […] Continue reading »

Get all available Currency code and name in Java

In Java, getAvailableCurrencies() is a static method of Currency class that returns all available currencies. Currency class is inside the […] Continue reading »

Different ways to iterate/loop a List of Integers in Java

In Java, you can iterate or loop a List object in different ways. In this short example, you will find […] Continue reading »

1 2 3 5