java

java

Java program to check if a given number is a prime number or not

Java program to check if a number is prime number or not. This post will show you two different ways to check if a number is a prime number or not in Java.

Read
java

Java program to check if a string is palindrome or not

Java program to check if a string is palindrome or not. A string is called a palindrome string if it is equal to its reverse or if we reverse the characters, it will be equal to the original string.

Read
java

How to reverse each word of a string in Java

Java program to reverse each word of a string. We will split the string into words, reverse each word and combine these words to create the final string. We will use StringBuilder to reverse the words.

Read
java

Java program to check if a string is empty or not

Java program to check if a string is empty or not. We can use isEmpty() method to check if a string is empty or not in Java. Also learn how to check if a string is null or empty.

Read
java

Java StringBuffer.reverse() method explanation with examples

Java StringBuffer.reverse() method is used to reverse the content or characters of a StringBuffer object in Java. StringBuffer object is mutable and we can also convert a string variable to StringBuffer and StringBuffer variable to string.

Read
java

Java String.replace() method explanation with example

Java String.replace() method explanation with example. String.replace method can be used to replace all occurrences of a character or sub string with another character or substring in a given string.

Read
java

Two different ways in Java to find all duplicate string characters

Learn how to find the duplicate characters in a string in Java in two different ways. We will learn how to do that by using two loops and with a single iteration with examples.

Read
java

Java program to check if a number is Kaprekar number or not

Java program to check if a number is Kaprekar number or not. We will also write a program to find all Kaprekar numbers in between 1 to 10000.

Read
java

Java Math signum function explanation with examples

Java Math signum function explanation with example. The signum function is used to get the signum function of the argument. It is a static function and this program will show you how to use it with example.

Read
java

Java Math copySign method explanation with examples

Java Math copySign method explanation with example. copySign method is used to copy the sign of one parameter to another parameter in Java. This post will show you how to use copySign method with examples.

Read