Java Program to Check Given Number is Even or Odd

In this post, we are going to see two ways to print whether a given number is even or odd in Java. First one is using if-else statements, and another one without using if-else statements, using the ternary operator in Java. So, let's dive into the discussion of how to check whether a given number is even or odd.


Step by Step logic of the given Program:

  1. First Create a Scanner class object to accept input from user.
  2. Accept input from user and store that in variable called num.

Java Program to Perform All Arithmetic Operations

In the world of programming, learning basic tasks like adding, mutiplying, deviding two numbers is a starting point for every beginner. So, in this post, we are going to explore how to perform all arithmetic operations using two numbers in Java, with a step-by-step explanation of the program. But before delving into that, you need to understand what the Arithmetic Operators in Java are.

There are total five arithmetic operators in Java as shown in below image:


Java Program to Print "Hello World" to the Console

In this tutorial, we will see how to start coding in Java and how to write our first Java program to print "Hello World" to the console. But first of all, you need to understand how to get started with and set up the Java development environment. So let's understand it in a step-by-step process and let's write our first Java program to explore the Java world.

Mostly Asked Spring Interview Questions

In this article, we are going to delve into some of the most frequently asked Spring interview questions along with their answers. Here, we are not going to make it complicated; rather, we are going to explain these questions with their answers in a nutshell. So that it will help you to easily prepare for the responses you should provide in your Java-related interviews.

Collections in Java With Hierarchy

Collections in Java provide a way to store and manipulate groups of objects. Think of collections as containers that allow you to efficiently manage, organize, and manipulate data.

In Java, the Collections Framework is a set of interfaces and classes that provide reusable data structures.


Collection Hierarchy:

Collection in java, collection hierarchy

Java Basic Interview Questions for Freshers

Java Basic Interview Questions for FreshersIn this post, we will explore some of the most frequently asked basic Java interview questions. It contains interview questions from different java topics like strings, threads, servlets, OOPs etc. These questions are easy to answer and it will also enhance your confidence and help you ace your Java interviews.