Let’s learn decimal number to binary in java using recursion. Decimal number to binary in java using recursion Here’s the program to convert decimal to binary using recursion. The logic to convert decimal to binary using recursion is, if(decimal == 0) return 0;else return(decimal % 2 + 10 * toBinary(decimal / 2)); public class DecimalToBinaryUsingRecursion…

Read More Decimal number to binary in java using recursion

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

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

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

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

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

Let’s learn encapsulation in java. encapsulation in java what is encapsulation? encapsulation is a procedure of binding data(variables) and methods together into a single unit. encapsulation is one of the four fundamental Object Oriented Programming(OOPS) concept. Other three oops concept are polymorphism, inheritance and abstraction. In encapsulation variables and methods in a class is hidden…

Read More encapsulation in java

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