Basic Java Programming Examples and Solutions
In previous post we learnt what is java programming or introduction of java programming, In this article you will learn basic of java programming with lot of java programming exercises, examples and their solutions.
Basic of Java Programming:
Quick Links:
I have assembled a list of java programs to practice for both novice as well as intermediate programmers.
Get CodeForHunger’s stories in your inbox
Join Medium for free to get updates from this writer.
Practice more to enhance your logical thinking. After this exercises you will surely gain some confidence and knowledge about java programming.
Basic Java Programming Exercises For Beginners:
- Write a first java program which prints message on the output screen.
- Write a java program to print given number is even or odd.
- Write a java program to swap two numbers.
- Write a java program to calculate gross salary of an employee using DA and HRA.
- Write a java program to print addition, subtraction, multiplication and division of given two numbers.
- Write a java program to find area of circle.
- Write a java program to find area of triangle.
Arrays In Java Programming Exercises:
- Write a java program to Accept and print given array elements.
- Write a java program to check whether given element is present in array or not.
- Write a java program to print Sum of given array elements.
- Write a java program to print Multiplication of given array elements.
- Write a java program to print Square of given array elements.
I hope above java examples and their solutions will help you to understand and gain some java programming knowledge :)
Originally published at https://www.codeforhunger.com.









