All Categories

Hello friends, welcome to Tech Naandi Solutions. Java has become the most popular and best programming language in the software industry. In this post, we will learn the top 5 JAVA Basic Programs.

We are here to help you to learn JAVA programming language, on our website we will provide all tutorials that you need to learn JAVA.

In this post, I am providing you the most important and basic programs for you, which help you to get the basic knowledge about JAVA programming.

I restricted copying of programs from my website because if you copy and paste these programs you won’t get knowledge of programming, try to type and learn programs 😊

The sum of two numbers in JAVA using Scanner Class

Example 1: Sum of Two Numbers

Output : Sum of two numbers is : 50

Example 2: Sum of Two Numbers Using Scanner Class

Output : 

Enter Number 1 : 75

Enter Number 2: 25

Sum of two numbers is : 100

JAVA Program to check Even or Odd Number

What is Even Number 

Even numbers are the numbers, that are exactly divisible by 2.All even numbers ends with 2,4,6,8 numbers, we can say that the number 234567894 is an even number because its ends with 2.😊

What is Odd Number 

Odd numbers are the numbers, that are not exactly divisible by 2.All odd numbers ends with 1,3,7,9, numbers, we can say that the number 2345678949 is an even number because it ends with 9.😊

Example Program

Output 1:

Enter Any Number: 344568

The Given number is Even

Output 2:

Enter Any Number: 3445689

The Given number is ODD

JAVA Program to check Leap Year

What is Leap Year

We all know that a common year has 365 days, but a leap year contains 366 days by adding a 1 extra day to the month of February. A leap year comes once every 4 years.

We use simple logic to find a leap year is that if any year that is exactly divided by 4, then we can call it as a leap year.

Leap Year Program

Output 1:

Enter Any Year: 2020

2020 is a leap year

Output 2 :

Enter Any Year: 2002

2002 is not a leap year

Java program to find Vowel or consonant

What are Vowel and consonant

Before going to program let us see what are these vowels and consonants. In an English Alphabets A E I O U are called as vowels and remaining alphabets are called as consonants

Now we are going to write a Java program to find the given alphabet is vowel or consonant by using switch case.

Program to find Vowel or Consonant

Output 1:

Enter Any Alphabet: A

A is a Vowel

Output 2:

Enter Any Alphabet: N

N is a Consonant

Output 3:

Enter Any Alphabet: 4

Please Enter only Alphabets

Write a JAVA program to find given STRING is Palindrome or not

What is Palindrome 

A palindrome is nothing but a string or a number will remain the same even if you reverse the string/number.



Madam, Level, POP,………………………….

OutPut :

Enter Any String: MADAM

MADAM is a Palindrome = true

Thanks for your support we will provide more tricks & tips for you. If you like our tricks, share these with your friends and join my Telegram Channel for more new tricks & tips.

Shopping cart
Sign in

No account yet?

Facebook Instagram YouTube WhatsApp WhatsApp Telegram
error: Content is protected by Narendra
How can i help you ?