Java Program to Check Armstrong Number or Not

  • Write a java program to check whether a number is armstrong number or not.

In this java program, we have to check whether a given number is an armstrong number or not and print the result on screen.
Armstrong number is a number that is equal to the sum of cubes of its digits.
Examples of Armstrong Numbers : 0, 1, 2, 3, 153, 370, 407 etc.

Java Program to Find All Factors of a Number

  • Java program to print all factors of a number using loop and using a function.

Given a number N, we have ti print all factors of N using a java program. Before jumping into java program, here is the brief overview of factors of a number. A number F is a factor of number N, if and only if F divides N completely without leaving any remainder(N % F = 0). For example, 3 is a factor of 24 because 3 divides 24 without leaving any remainder.

Java Program to Print Armstrong Numbers Between 1 to N

  • Java program to print all armstrong numbers between 0 to N.

In this Java program, given a number N we have to print all armstrong numbers between 0 and N. Here is a brief introduction of armstrong number. Here is the list of first few armstrong numbers 0, 1, 2, 3, 153, 370, 407 ...

Java Program to Convert Celsius to Fahrenheit

  • Java program to convert temperature from Celsius to Fahrenheit.
  • Write a java program to convert temperature from Celsius to Fahrenheit.

In this java program, we have to convert celsius temperature to fahrenheit temperature scale. We will first take a celsius temperature as input from user and then convert it to fahrenheit temperature and print it on screen.

Java Program to Convert Fahrenheit to Celsius

  • Java program to convert temperature from Fahrenheit to Celsius.
  • Write a program in java to convert temperature from Fahrenheit to Celsius.

In this java program, we have to convert fahrenheit temperature to celsius temperature scale. We will first take a fahrenheit temperature as input from user and then convert it to celsius temperature and print it on screen.

Java Program to Find LCM and GCD of Two Numbers

  • Write a program in java to find gcd and lcm of two given numbers using loop and recursion.

Given two integers, we have to find the lcm and gcd of two numbers. Before jumping into java program, here is the brief introduction of lcm and gcd od two numbers.

Java Program to Print Prime Numbers between 1 to 100

  • Java program to print all prime numbers between 1 to 100 using for loop.

In this java program, we have to print all prime numbers between 1 to 100. There are various methods of primality testing but here we will use a basic method of repetitive division.

Final Keyword In Java

final keyword in java is used to impose various restriction on variables, methods, classes and method parameters. final enforces different restrictions depending on the type of entity it is applied on.

Super Keyword in Java

super is a keyword in java which refers to the immediate parent class object. Unlike this reference which refers to current object, super refers to immediate parent class object.

this Keyword in Java

this is a keyword in java which can be used inside a method or a constructor to refers to the current object. Except in static methods, this keyword can be used in any method to refer to current object. this keyword can be used to refer to any member variable or member method of current class.