Java is an Imperative, Object-Oriented, Class-Based Programming Language.
It was created in 1991 and lead by Sun Microsystems Employee, James Gosling. Its design philosophy was greatly influenced by C and C++ due to its syntax being so familiar with programmers. Sun released the first public implementation in 1996, and promised that Java could run anywhere without having to change any code. Soon, major browsers added the ability to run small Java applets. Java began to grow in popularity. Between 2009-2010, Oracle acquired Sun Microsystems.
Rather than being compiled to a particular type of machine code, Java programs are compiled into 'bytecode' and can be run by the Java Virtual Machine (JVM). This type of compiling isn't unique to Java and Sun did not invent it.
Java is also the main language for Android application development. Android OS doesn't use the Java Virtual Machine to execute code. Rather, Google developed its own program, Android Run Time, to run Java code. This was the basis for the lawsuit with Oracle.
Note that Java, the programming language, is different from Java, the platform, which is discussed in greater detail in the Java Software Platform page.
Not to be confused with JavaScript.
Hello World App
public class fileName {
public static void main(String[] a){
System.out.println("Hello World!");
}
}
This program outputs "Hello World" to the console. Note that fileName should be replaced with the actual name the file was titled.
Variable Declaration and Concatenation
public class fileName {
public static void main(String[] a){
int a = 10;
int b = 7;
String c = "Bob";
System.out.println(a + b);
//will output 17
System.out.println(b + c);
//will output 7Bob
System.out.println("hello, " + c);
//will output hello, Bob
}
}
Variables declarations must match their type and failing to do this will cause the compiler to throw an error. Java will concatenate if one or both types are strings, otherwise, Java will add the numbers.
For Loops
public class fileName {
public static void main(String[] a){
for(int i=0;i<10;i++){
System.out.println(i);
}
}
}
This program will output the numbers 0 thru 9 in the console. Java uses a C-like For Loop.
Works that are written in the Java Programming Language
- Alien Quarantine
- Avalon: The Legend Lives
- Bang! Howdy is an online free-to-play strategy game.
- Bejeweled Twist
- Biniax
- Bomberman Tower is a spiritual successor to Pocket Bomberman with roguelike elements. Made in libGDX.
- BotFighters
- Boulder Dash: Rocks!
- Cubis 2
- Don Chan 2 Slot
- Doom II RPG
- Falling-sand game
- The Flowering Nose
- Football Tycoon
- FreeCol
- Frozen Bubble
- FunOrb
- Galaxian
- Gangstar
- Gangstar: Crime City
- GauntNet
- Gbanga
- God of War: Betrayal
- Hotel Tycoon Resort
- Icy Tower is a simple freeware game in which the only goal is simply to climb as high up the tower as possible.
- Insaniquarium
- Jet Set Radio
- Ka-Glom!
- Kiekko.tk
- Lemony Snicket's A Series of Unfortunate Events (video game)
- Medieval Kings Chess II
- MegaMek
- Miami Nights: Singles in the City
- Minecraft Is a survival/sandbox game where players can mine and place blocks anywhere. It is the most popular game of all time. However, Minecraft Pocket Edition and Minecraft Bedrock Edition are written in C++
- NBC Sports Figure Skating
- NBC Sports Real Golf
- Need For Madness?
- New York Nights 2: Friends For Life
- One: Kagayaku Kisetsu e
- PeaceMaker
- PlayOK
- PoxNora
- Project Zomboid
- Puzzle Pirates is an massive multiplayer online game
- R-Type
- Revenge of the Titans
- Roboforge
- Robotfindskitten
- RuneScape is a popular browser MMORPG and was originally written in Java. In 2016, the game was completely rewritten to C++. The original version was re-released as RuneScape Classic
- Snuggle
- Soda Constructor
- Shinobi (Remaster of the arcade game)
- Space Impact
- Spiral Knights
- Splatterhouse
- Split/Second
- Tokyo City Nights
- Tower Bloxx
- TriadCity
- TripleA is an open-source grand strategy game (similar to Axis and Allies) written in Java.
- Urbanoids
- Wakfu
- Wolfenstein RPG
- World Series of Poker: Pro Challenge
- Worms Golf
- Worms: A Space Oddity
- Wurm Online
- Ys: The Oath in Felghana
- Zatikon is an online is a turn-based game that takes place on a grid. Using units they deploy from a castle at their end of the board, the players try to move onto the castle of their opponent.