java

java

Java program to print inverted Pyramid patterns in different ways

Java program to print Pyramid pattern in two different ways. We will learn how to use for loops and while loops to print the pattern in this post with example programs.

Read
java

Java program to print the vowels in a string

Java program to print the vowels in a string in a string in different ways. We will learn how to iterate and find the vowels, remove all duplicate characters from the string.

Read
java

Java program to round a number to n decimal places

Java program to round a number to n decimal places in 3 different ways. This post will show you 3 different ways to round a number in Java with examples.

Read
java

4 ways in Java to convert a decimal value to octal

Java program to convert a decimal value to octal in 4 different ways. We will learn how to use a while loop, a separate function, a for loop and Integer.toOctalString function to convert a user given decimal value to octal in different Java example programs.

Read
java

Java program to print left-aligned and right-aligned staircase patterns

Java program to print a left-aligned or right-aligned staircase pattern with user input height. It will also show how to print a real staircase pattern in Java.

Read
java

Java program to find the largest and smallest of n user input numbers

Java program to find the largest and smallest of n user input numbers. We will learn how to write this program in Java by using an ArrayList and without using an ArrayList.

Read
java

Java vector addAll method explanation with example

Java vector addAll method is used to append all items of a collection to a vector. This post will show you how to use the addAll method with examples.

Read
java

Java program to find the largest and smallest of three numbers

Java program to find the largest and smallest of three numbers in three different ways. We will use if..else-if..else statements, separate variables and separate list to write this program in Java.

Read
java

3 ways in Java to print a reverse half pyramid pattern

Java program to print a reverse half star and number pyramid pattern in 3 different ways. We will learn how to use for loops, while loops and number pyramid pattern with examples.

Read
java

3 ways in Java to print Hello World without semicolon

Java program to print hello world or any other string without semicolon. We will use if-else statement, for loop and StringBuilder append method to print the message without any semicolon in Java.

Read