java

java

Java program to read user input numbers with blank spaces

How to read user input numbers with blank spaces in Java. The program will read the numbers and add them to an array. We will learn how to solve it by using a loop and by split the string.

Read
java

Java ArithmeticException explanation with examples

Learn how ArithmeticException in Java works with examples. Learn about the constructor of ArithmeticException and how this exception is thrown in Java.

Read
java

Java method overloading explanation with example

This post will explain how method overloading works with examples. We will learn how method overloading works with different numbers of parameters in Java with example program.

Read
java

Java method overriding explanation with example

This post will explain how method overriding works with examples. Learn how access specifier works in method overriding, how to access the methods in a superclass and the rules of method overriding.

Read
java

How to format a Date in AM/PM in Java

Learn how to format a Date in AM/PM in Java. We will use the SimpleDateFormat class to format a string to AM/PM date in Java and how to convert a 24 hour time to 12 hour with AM/PM.

Read
java

What is hybrid inheritance in java

What is inheritance and hybrid inheritance in Java. This post will explain about hybrid inheritance with different examples.

Read
java

Java checked and unchecked exceptions example

Learn about checked and unchecked exception in Java with examples. Also learn what is exception, how to handle exceptions in Java with try-catch blocks.

Read
java

7 ways to sort an ArrayList of objects in Java

Java program to sort an ArrayList of objects. We will learn 7 different ways in Java to sort an ArrayList of objects.

Read
java

Java program to check if a number is perfect square or not

Check if a number is a perfect square or not in Java. We will learn two ways, by using Math.sqrt and by using Math.floor with Math.ceil with examples for each.

Read
java

Java program to filter a map by key and value

Java program to filter a map by key and value. We will learn four different ways to filter a map in this post, by using a loop and with Stream API.

Read