Java Programming for Beginners
Learning to program means learning how to solve problems using code. This simple programming examples are fully intended for the beginners who have just started coding. It is a collection of progressively less difficult exercises that are suitable for people who just started learning . After completing this examples, you would be familiar with the basic Java programming skills and will also increase your logical thinking ability. In order to make good progress in your programming task, you need to test your work as early and as thoroughly as possible.
How to Find the Sum of Two Numbers in Java?
Find the average of the numbers in Java
Check whether number is even or odd in Java?
The MODULUS Operator %
The modulus operator finds the modulus of its first operand with respect to the second. The % operator returns the remainder of two numbers. For instance 10 % 3 is 1 because 10 divided by 3 leaves a remainder of 1. You can use % just as you might use any other more common operator like + or -.
Reverse a string in Java
You can do this in another simple way by using StringBuilder Class in Java
Check whether string is palindrome or not in Java
You can do the same in another simple way
Find the sum of all the numbers in an array in Java
Calculate Area of Triangle in Java
Area of a triangle can be calculated using the following formula, Area = (b*h)/2, where b is the base of the triangle and h is the vertical height of the triangle.
Fibonacci Series in Java
In fibonacci series, next number is the sum of previous two numbers for example 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 etc. Here set the limit as 10(int limit=10), you can change it as much as you want.
Find duplicate characters in a String in Java
The following example find duplicate characters in a String and count the number of occurances using Java