java

java

What is an Exception in Java and types of exceptions

Let's say you have a program that takes input from the user and finds out the reminder of 100/(user-input-number).

Read
java

Java Program to find all Evil Number from 0 to 100

Evil number is a non negative number that has even number of 1 in its binary representation. E.g. Binary representation of 5 is 101 . It has two 1 in binary form. So it is an evil number.

Read
java

Java 8 LocalDate Example program to find difference between two dates

In this example , we will learn how to find difference between two dates in Java 8. Date difference is required to find the age of a person , to find how many days/months/years for a specific date etc. In this tutorial, I will show you how to find the difference between two dates in Java 8. Java 8 introduced one new class called 'LocalDate' .

Read
java

Write a Java program to calculate Discount Price

Java program to calculate the discount price and the final price of a product in 3 different ways. We will learn how to calculate the discounted price with user input values with different methods and classes.

Read
java

Java Program to copy a file

In this tutorial, we will learn how to copy a file in java . In the example explained below , we are showing one 'pdf' file to copy and create a different file in the same location.

Read
java

Java Program to count the divisors of a number

In this tutorial, I will show you how to find the total number of divisors for a number starting from 1. Let's move through the steps first :.

Read
java

Java program to Print Floyd Triangle

A Floyd triangle is a right angled triangle that is created by using increasing numbers. For example , following is a Floyd triangle of height 6 :.

Read
java

Java program to write an infinite loop using for and while

Infinite loop means a loop that never ends. In this tutorial, I will show you how to write an infinite loop in Java using for and while loop.

Read
java

Java program to find Harshad or Niven number from 1 to 100

This tutorial is to find Harshad or Niven number in Java. A Harshad or number or even number is a number that is divisible by its digits.

Read
java

Java program to find Saddle point of a Matrix

In this tutorial, we will learn how to find the saddle point of a matrix in Java. I will give you two examples. Try to run the program with different examples and let me know if you have any query.

Read