# Magic Number in Java

Magic Number is a number whose sum of the digits when recursively added to the point that a single digit is obtained, comes out to be 1. For example, consider the number 1882. Sum of the digits in the first iteration for 1882: 1 + 8 + 8 + 2 = 19. Sum of the digits in second iteration for 19: 1 + 9 = 10. We have still not obtained a single digit sum. Let’s sum the digits again.

# RSA Algorithm in Java (Encryption and Decryption)

The term RSA is an acronym for Rivest-Shamir-Adleman who brought out the algorithm in 1977. RSA is an asymmetric cryptographic algorithm which is used for encryption purposes so that only the required sources should know the text and no third party should be allowed to decrypt the text as it is encrypted. RSA works on the fact that it is very hard to factorize large numbers (order of 100+ digits). The term “Asymmetric” signifies that there are two keys public

# Java FizzBuzz Program

In this article, we’ll talk about what is FizzBuzz and how to implement FizzBuzz in Java. What is FizzBuzz? FizzBuzz is a group game for children to understand the concept of division and multiplication. In which, each child counts the numbers (starting from 1) following these rules: if that number is divisible by ‘3’ then replace the number by word fizz. If that number is divisible by ‘5’ then replace the number by word buzz. In case that number is

# Infinite Loop in Java

Infinite loop in java refers to a situation where a condition is setup so that your loop continues infinitely without a stop. A loop statement is used to iterate statements or expressions for a definite number of times but sometimes we may need to iterate not for a fixed number but infinitely. For such situations, we need infinite loops in java. There are basically three looping structures in java: for, while and do while. These structures are used for iterations

# Convert String to Byte Array or Byte Array to String in Java

Sometimes we need to convert Strings into Bytes because of several reasons like, to save content to the file, sending data over a network or it can be any other reason. So in this tutorial we’ll see how we can convert string to byte array or byte array to string in Java. Convert String to Byte Array in Java Method 1: Using String.getBytes()

Output: Platform’s encoding = [[email protected] Contents of byte Array = [84, 104, 101, 32, 67, 114,

# 6 Best Lightweight Java IDEs

When it comes to write code in any language, all of us choose an IDE to write the code because of the syntax highlighting, auto-complete, editing and running in the same environment (without using any extra command prompt to run the code), in-built debugger, reduced setup time etc. If we want to write code in Java, the names of IDEs that comes into our minds are – NetBeans, Eclipse, IntelliJ IDEA. Which are really good IDEs to work in Java.