Java History
I have the pleasure to learn Java through an amazing instructor and with some great classmates. Java is a general-purpose programming language that is class based, object oriented and is designed to run with different operating systems. Java applications are usually compiled to bytecode that can run on any Java virtual machine regardless of the computers platforms-as long as there is the Java virtual machine installed. As of 2018, Java was one of the most popular programming languages in use according to GitHub.
Java was started by James Gosling, Mike Sheridan and Patrick Naughton in June of 1991. Java was originally designed for interactive televisions but became way too advanced for the digital cable television platforms at the time. The language was originally named Oak-which was named after an oak tree that was growing outside James Gosling’s office. Later the language was named Green and then finally named Java from Java coffee. The rest is history, Java was and still is so popular that another programming language that has no link with Java was named after it (JavaScript). Now that we have gone a little in the history of Java, let us begin to learn the actual language.
Getting your machine ready for Java programming
So first things first, Java wont run on a normal text editor like sublime or atom unless you have modified the text editor with certain plugins which we may or may not get into in further post, but for now we will download and use Netbeans but first we must install JDK or Java Development Kit. This contains the compiler (the program that converts instructions into a “machine-code” or “lower level” form so that it can be understood and executed by the computer. FYI make sure with macs you download the right netbeans version because I have experienced and also herd others downloading the newest version and it was not working, so be mindful of that.
Netbeans
Now that we have everything we need to start writing Java code, let us begin with the basics. Netbeans has many built-in features there to help the developer perfect his code. There is Syntax highlighting, which makes the code easier to read by applying different colors to certain elements, code completion and Intellisense which gives you hints and improves your coding speed by autocompleting certain code and gives you hints in many instances to write your code more efficient. When code is written wrong there is error highlighting and correction hints that try and help you solve the problem at hand. The debugger feature in my opinion is one of the most important of the bunch. This allows you to step through your code line by line while the program is running-which allows you to see how your code is executing and will help you uncover problems when you are not getting the desired outcome of your program.
Key Concepts
Computer
First will be to understand exactly what we are programming to….A computer. A computer is exactly was it sounds like- an electronic device that processes or computes data according to a set of instructions contained in a program.
Data & Information
Data and information are two words that very frequently are used interchangeably but actually have different meanings. Data is the facts and statistics collected from which information is then built from. Information is the analyzed data, and with the analysis of the data-it then has a meaning.
Programs & Programming
A program is a set of instructions that, when run on a computer, will solve a particular problem. Programming is the action of writing those instructions for the computer to solve the problems at hand. The computer only does what you tell it to do so this entails that you must be able to solve a problem on paper before you can be able to instruct the computer on how to solve it.
Models, Metaphors & Objects
We use models to set classes that will “model” the objects associating with creating, editing, and building a Java program and then we calculate the result. One of the most important metaphors that we use in Java is the Object. This metaphor is not used only in Java but used in all object oriented languages. Objects represent a “object” which has its own properties such as weight, volume, color, & can also have actions that they can perform like walk, run, jump, fly etc.
Specifications, Syntax & Semantics
Specifications are a very important to the process of writing software. They tell us what problem we have to solve. With out that, we wouldn’t know what kind of program to write. They do not have to be pages and pages, as long as there is a problem stated and then any constraints around the problem to be aware of, that will do it. Syntax is important to actually compiling your code, but as you’ll learn; it is just as important to understand the meaning and purpose or “semantics” of the various language constructs and how and when to use them to solve a problem.