# Java programs

## Convert decimal number to binary in java without using array

Let’s learn convert decimal number to binary in java without using array. Convert decimal number to binary in java without using array To convert decimal number to binary without using array we are using StringBuilder class. Here’s the java program to convert decimal to binary without using array. public class DecimalToBinaryWithoutArray { static void toBinary(int…

Read More Convert decimal number to binary in java without using array

## Multiply two numbers without using arithmetic operators in java

Let’s learn multiply two numbers without using arithmetic operators in java. Multiply two numbers without using arithmetic operators in java Let’s learn how to multiply two numbers without using arithmetic operators using for loop. import java.util.Scanner; public class MultiplyWithoutArithmeticOperators { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int number1, number2, multiply…

Read More Multiply two numbers without using arithmetic operators in java

## Subtract two numbers without using arithmetic operators in java

Let’s learn subtract two numbers without using arithmetic operators in java. Subtract two numbers without using arithmetic operators in java We can subtract two numbers without using arithmetic operators. To do that we have written static int function subtractNumber() to subtract two numbers which return subtraction of two numbers. To subtract two numbers without using…

Read More Subtract two numbers without using arithmetic operators in java

## Java program to find area of triangle

Let’s learn java program to find area of triangle. Java program to find area of triangle In the below area of triangle java program first user enters base-width and height of triangle using nextDouble() method of Scanner class. To calculate area of triangle java formula is: Area = (width * height) / 2 Here’s the…

Read More Java program to find area of triangle

## Addition of two numbers in java using class and objects

Let’s learn addition of two numbers in java using class and objects. Addition of two numbers in java using class and objects Let’s learn to print addition of two numbers in java using classes and objects. Here’s the java program to add two numbers in java using class and objects or sum of two numbers…

Read More Addition of two numbers in java using class and objects

## Java program to find area of circle using bufferedreader

Let’s learn java program to find area of circle using bufferedreader. Java program to find area of circle using bufferedreader We can also calculate area of circle using BufferedReader class. BufferedReader class reads text from a character-input stream, buffering characters so as to provide for the efficient reading of characters, arrays, and lines. Here’s the…

Read More Java program to find area of circle using bufferedreader

## Array java programs examples with output for practice

Let’s learn array java programs examples with output for practice. Array java programs examples with output for practice In this post we are going to learn array programs examples with output for practice. Java program to print odd and even numbers in an array Find minimum and maximum values in a java array Java program…

Read More Array java programs examples with output for practice

## Anagram java program

Let’s learn anagram java program. Anagram java program String anagram in java Two strings can be an anagram string if characters of one string contain same characters of another string by regrouping the characters. For example, Anagram example in java: String1 = “silent”; String2 = “listen”; In the above example String1 and String2 are two…

Read More Anagram java program

## Perimeter of parallelogram in java

Let’s learn perimeter of parallelogram in java. Perimeter of parallelogram in java In the previous post we learnt area of parallelogram. Now let’s learn to calculate perimeter of parallelogram. As we know parallelogram shape opposite sides are equal. So formula to calculate perimeter of parallelogram is: perimeter = 2(a + b) where ‘a’ and ‘b’…

Read More Perimeter of parallelogram in java