C C++ Java Data Structure Python JavaScript CSS Ajax PL/SQL PHP Puzzles C programs C++ programs Java programs

Home » Java solved programs

Java Basic Input Output Programs, Examples

This section contains solved programs of Java Basic Input, Output programs with basic mathematical, conditional statements and looping concepts.

All programs have explanation, output on different inputs.

List of Java Basic I/O Example Programs

Find some of the programs (which are popular and most searched on the web) with source code, explanation and output.

  1. Java program to print "Hello world" (First program in Java).
    Learn: How to write, compile and execute our first program in Java, in this program we will print some text (Hello World) on the screen.
  2. How to print different type of values in Java?
    Here, we will learn how to print different type of values using Java program? In this program, we will declare and define different variables with values and print them.
  3. How to read and print an integer value in Java?.
    Through this program, we will learn how to read (input) an integer number from user and print the input value on the output screen?
  4. Java program to find sum and average of two integer numbers.
    This is a simple java program, in which we are taking input of two integer numbers and calculate their SUM and AVERAGE.
  5. Java Program to find square, cube and square root of a given number.
    Math.pow() amd Math.sqrt() Methods in Java: In this program, we will take an integer number will find their Square, Cube and Square Root of given number through these methods?
  6. Java program to check whether input number is EVEN or ODD.
    Check EVEN or ODD in Java: In this program, we will input an integer number and check whether it is EVEN or ODD.
  7. Java program to swap two numbers with and without using third variable.
    Swap two integer numbers in Java: Here, we will input two integer numbers and swap them through two methods 1) Using third variable and 2) without using third variable.
  8. Java program to print uppercase and lowercase alphabets.
    In this java program, we are going to print uppercase and lowercase alphabets from A to Z and a to z using loop, it’s a very simple program demonstrating use of lopping with alphabets as loop counter.
  9. Java program to print Christmas tree.
    In this java program, we are going to learn how to print a Christmas tree? By using nested looping and basic concept, we are printing the tree using stars.
  10. Java program to print a rectangle using stars (java pattern program).
    In this java program, we are going to learn how to print a stars pattern to make a rectangle by using stars?
  11. Java program to print the diamond shape of stars.
    In this java program, we are going to learn how to print the diamond shape of stars?
  12. Java program to print pattern of alphabets.
    In this java program, we are going to print pattern of alphabets? Here, we are taking input for number of rows and printing the pattern according to input.
  13. Java program to print Pascal's triangle.
    In this java program, we are going to read number of rows and printing Pascal’s triangle according to the input.
  14. Java program to generate permutation and combination of the numbers.
    In this java program, we are going to generate permutation and combination of the numbers.
  15. Java program to print all Armstrong numbers between given range.
    In this Java program, we are going to learn how to check and print all Armstrong number between given range (from starting number to end number)?
  16. Java program to count total positives, negatives and zeros from an array.
    In this java program, we are going to count total number of negative, positive and zero elements in a given array of integers.
  17. Java program to find sum of all digits.
    In this Java program, we are going to learn how to find sum of all digits? Here, we are reading an integer number and finding sum of its all digits.
  18. Java program to find mean of a given number.
    In this java program, we are going to learn how to read N numbers and find the mean of all input number?
  19. Java program to build a calculator.
    In this java program, we are writing code for a simple calculator. Here, we are performing multiple basic mathematical tasks using switch case statement and do while loop.
  20. Java program to calculate compound interest.
    In this java program, we are going to learn how to calculate compound interest. Here, we are reading principle, rate and time and calculating compound interest.
  21. Java program to swap two numbers using function.
  22. Java program to check number is positive, negative or zero.
  23. Java program to find largest number among three numbers.
  24. Java program to check whether year is Leap year or not.
  25. Java program to demonstrate example of enum data type.
  26. Java program to demonstrate example of this keyword.
  27. Java example for while loop demonstration.
  28. Java example for do while loop demonstration.
  29. Java - Calculate Compound Interest using Java Program. (Code Snippet)
  30. Java - Greatest Common Divisor or Euclidean Algorithm Program or Highest Common Divisor. (Code Snippet)
  31. Java - Greatest Common Factor or Euclidean Algorithm Program or Highest Common Factor. (Code Snippet)
  32. Java - Calculate LCM (Least Common Multiple) using Java Program. (Code Snippet)




Sponsored Links




COMMENTS