# Neon Number in Java

Here in this tutorial you will learn how to check a neon number in Java. What is a Neon Number? Neon numbers are those numbers whose sum of the digits when squared is exactly the same as the number itself. For example, the number 9. Now the square of the number, 9 is 81. The sum of the digits in the square, 81 is 8 + 1 = 9, which is equal to the number itself. Hence, the number 9

# Java Random Number Generator

Random numbers may be required for sorts of programming jobs. For example, statistical sampling, computer simulation, cryptography, and other areas where producing random unpredictable results is desirable. Java provides certain ways in which we can generate random numbers. Although, the generated random numbers are pseudo-random, they get the work done mostly. We can generate random numbers in Java using the following two ways. Java Random Number Generator Method 1: lang.Math To generate random numbers, we can use the Math.random() method.

# How to Square a Number in Java

We can square a number in Java in no less than two different ways. Let have a look on each method one by one. Method1: Multiplying the Number by Itself To square a number x, we can multiply the number by itself. Y = x * x. Java Program for the above method.

Output: Enter a number: 5 The Square of the number is : 25 Method 2: Using the Math.pow() Function Lets have a look how we can

# 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.

# 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

# Java Reference Variable

We often are stuck at discussion about Objects and their references, it is known fact that unlike C or C++, java doesn’t allows variable access using pointers, well why it does not allows is itself a whole topic which you can read here. Today we will discuss about what all types can be given to java variables or objects. Before moving on to that concept let’s have a look at what do we mean by Reference Variable? Java Reference Variable