What is Java?
Java was first released in 1995 and is currently one of the most popular programming languages in the world, with an estimated 9 million developers using Java world wide to build software on everything from web applications to game consoles. It’s a general-purpose, high-level programming language, which means it was designed to resemble human language as opposed to low-level programming languages, like Assembly, where programs are written in something closer to the 0’s and 1’s that machine’s read.
Who created Java?
James Gosling, Mike Sheridan, and Patrick Naughton at Sun Microsystems (now Oracle) began the Java development project in 1991. Java was originally called Oak and the initial design and main concept for the languages use was to create interactive cable technology for home entertainment systems, but the technology was met with little interest from the large cable companies and never adopted.
The project was retooled and went through several different project names and incarnations until a few years later when engineers Patrick Naughton and Jonathan Payne used the programming language to build a web browser (HotJava) that could support moving objects and dynamic content. Subsequently, Sun Microsystems released Java 1.0 to the public in 1995 and the language quickly took off as the language’s design was easily integrated into the needs of internet technology.
Sun Microsystems was eventually acquired by Oracle who re-licensed most of its Java technologies under the GNU General Public License in 2007. Starting with Java 8 (2014) public support for Java is free, earlier versions are only supported on a commercial basis.
Why is Java so popular?
Because Java is initially compiled it’s considered a safe and secure language which makes it popular in industries where security is important. It was one of the first official object-oriented-programming (OOP) languages developed and it has extensive libraries which make Java a robust and flexible language to program in.
Most significantly though, Java was one of the first truly platform independent programming languages. Programs originally written for one operating system (say Windows) can then be executed on another (say Linux). Being able to develop software that can easily run on multiple operating systems saves time and money, so Java became a popular choice for software engineers and companies. This portability became particularly important after the internet took off as the need to run applications across multiple operating platforms became a high priority.
This portability is also described by the short-hand WROA, short for write-once-run-anywhere.
How did Java achieve platform independence?
Prior to Java most programming languages followed two different processes: Compiled and Interpretive.
A compiled language follows a compile-link-execute format. This means a programmer writes a program in a high-level-language, then a compiler converts the entire code into a low-level program called an object and finally, the object files get all linked together into executable files that the computer’s CPU can read and run.
Other languages like Lisp or Python use an interpretive process which means the high-level program gets converted to the low-level object line by line on the fly.
A good analogy, used by Dr Jeffrey S. Carroll is to compare the compiler process to someone translating an entire book and to think of the interpretive process as someone translating a conversation as it happens.
There are pros and cons to both compiled and interpretive language and there’s a ton of debate as to what type of language should be used and where but the interesting thing about Java is that it’s been designed to leverage the advantages of both processes.
Java’s doesn’t compile an object file, instead, it takes the high-level program written and compiles it into something called bytecode. The only thing the programmer has to worry about is creating a program that compiles and runs properly to bytecode, once that goal has been achieved the program is portable and will run on any platform that has a Java Virtual Machine installed.
What’s a Java Virtual Machine? (Stay with me, we’re almost finished)
Java engineers isolated issues that were specific to various platforms and developed different Java interpreters that address these platform-specific issues. When you write a Java program it get’s compiled to bytecode for the Java Virtual Machine, which then acts as a line by line interpreter. When the program comes to parts of the bytecode that might cause issues the Java interpreter links in appropriate code specific to the platform the program is running on and then keeps going.
So the way Java works it that it’s compiled first and then link-executed specifically to the platform it’s being run on. Leveraging the advantages of both processes.
If Java is a WROA language can I make an iPhone App with it?
Not easily. Objective-C and now Swift are the programming languages used to natively develop iPhone/iPad app development. However, there are some frameworks available that will let you develop iPhone apps with Java.
Where is Java used the most?
Andriod, a mobile OS developed by Google uses Java extensively to develop applications. Apache HaDoop, a popular big data software library is a framework that was developed with Java. Some games like MineCraft were/are developed using Java and stock market algorithms, scientific computing applications and banking programs often use Java as they’re industries that require precision and speed.
I guess you can consider them very distantly related as their both object-orientated-programming languages but outside that and some syntax (they both have a penchant for semicolons and curly brackets) the two languages don’t have much in common.
What are good online resources for learning Java?
Codecademy has a good intro course that will let you try out Java without needing to install the language or an IDE onto your computer and CodingBat has a large number of practice problems that also run in the browser.
Derek Banas has an excellent YouTube playlist of Java specific tutorials that I highly recommend. Coursera offers a 5-course specialization taught by Duke University if you’re looking for something more traditionally academic and EDx has MicroSoft verified courses on Java if you’re looking for something directly industry related. Both Coursera and EDx have a rabbit hole of courses on Andriod, HaDoop and other interesting computer things that are taught using Java.