Category Archives: Basic Java Programs

Java Palindrome String Check

Task: Write down a Java String Program to check for Palindrome. The Source Code of Java Program Check for Palindrome import java.util.Scanner; /** * * @author www.EasyCodeBook.com */ public class StringPalindrome { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print(“Enter a String to check for Palindrome: “); String s1=input.nextLine(); String s2=””;… Read More »

Java Day Number to Name switch Program

Task: Java Day Number to Name switch Program Java Program – The Use of Switch Statement through practical Java programming- Input a day number from the user Display Day Name. Source Code – Java Day Number to Name switch Program /* * Java Program – The Use of Switch Statement * Input a day number… Read More »

Write and Execute Java Addition Program

Task: Write and Execute Java Addition Program. This Java Programming Tutorial will provide and explain the source code of a basic addition program in Java. The program will input two numbers from the user at run time. The Java program will calculate the sum of these two numbbers and will display the answer of addition.… Read More »

Java Program Area of Triangle by Three Sides

Task: Write a Java Program Area of Triangle by Three Sides. The Source Code of Java Program Area of Triangle by Three Sides /* * Write a Java program to find the area of a triangle when lengths of three sides are given. */ package trianglearea; import java.util.Scanner; /** * @author www.EasyCodebook.com */ public class… Read More »

Java Program to Calculate Area of Circle

Task: Java Program to Calculate Area of Circle What is the formula for calculating Area of Circle? The required formula for calculating area of circle is: area = π . r2 Where r is the radius of the circle and π  is a mathematical constant with fixed value 3.1415. We should declare a constant for pi… Read More »

Write and Execute First Java Program in NetBeans

Task: How To Write and Execute First Java Program in NetBeans IDE. Note: In this Simple Java Tutorial we will assume that you have already downloaded and installed Java Development Kit JDK and Net Beans 8.1 IDE or higher. Short Steps: Step 1: Start Net Beans IDEStep 2: Now you will Click on File menu… Read More »