java

java

How to reset a Scanner in Java

Learn how to reset a scanner in Java by using the reset() method. We will learn the definition of reset() method with example.

Read
java

Java program to find the cube of a number

Learn how to find the cube of a number in Java in two different ways. The program will take the number as input from the user and print the cube.

Read
java

Java program to find the perimeter of a circle

Java program to find the perimeter of a circle. We will learn two ways to find the circle perimeter in Java.

Read
java

How to overload main method in Java

We can overload the main method in Java. We can create another main method with different arguments. Let's see how to do that.

Read
java

Write a number guessing game in Java

Java program to write a number guessing game. This program will take one number as input from the user for a number of times and try to match with a secret number.

Read
java

Java example program to find the area of a Parallelogram

Java program to find the area of of a parallelogram. The program will take base and height as inputs from the user and print the area.

Read
java

How to reverse a string in Java

How to reverse a string in Java. We will learn two different ways. The first way will iterate through the characters and the second way will use StringBuffer.

Read
java

3 ways in Java to print the Arithmetic Progression(AP) series

3 different Java programs to print arithmetic progression. The post will show you how to use one for loop and one recursive method to print an arithmetic progression.

Read
java

Java program to find the sum of the series 1 + 1/2 + 1/3 + 1/4 or harmonic series

Java program to find the sum of the series 1 + 1/2 + 1/3 + 1/4 or harmonic series. This program will take the value of n as input from the user and print the sum of the series from 1 to n.

Read
java

How to remove empty values while split a string in Java

Java program to remove empty values while split. A string is given with words separated by comma, write a Java program to get all non-empty words in an array.

Read