which ide to use with java code example

Example: best IDE for java

The best IDE for java is different based on what you need, the two main ones that i see alot (and personally use) are:
1.) IntelliJ 
2.) Eclipse
IntelliJ is a very feature packed IDE with great addons and some great built in factors, Its only real downsides are its CPU and memory usage (There is also a paid version but the free one works just fine!)
Eclipse is a very light weight IDE where almost everything is installed via addons, making it super configurable

TL;DR:
If you want a feature packed IDE go IntelliJ, if you want a light weight IDE go Eclipse

Tags:

Java Example