This site works best with JavaScript enabled!

Example programs in Java

Here you can see the source codes of some simple Java programs.
The following programs are really primitive, but for a beginner they might be interesting.

Programs (console):

Addition of two numbers

Numbers to infinity

Area of a circle

Random generator

Sum of all numbers from 1 to...

Prime numbers from... to...

All factors of a number

Gcd and lcm of two numbers

Guess a number
Share this page
Posted on 17.10.2011 | Last modified on 20.11.2016