The Ultimate Guide to Learn Java Programming and Computer Hacking (java for beginners, java for dummies, java apps, hacking, how to hack, hacking exposed)
The Ultimate Guide to Learn Java Programming Fast (Java for Beginners, Java for dummies, how to program, java apps, java programming)
Amazon Prime and Kindle Lending Library
Introduction
The company behind the Java programming language is the Sun Microsystems. The language was initially introduced in the year 1991. It was developed by a team of people consisting Mike Sheridan, Ed Frank, Chris Warth, Patrick Naughton, and James Gosling. Due to its object-oriented nature, the Java language can be reused with regards to data focus, classes creation, written instructions, and the creation of both instances and objects.
The Four Java Platforms
There are four primary platforms in the Java programming language. They are as follows:
- Java Standard Edition (Java SE)
- Java Enterprise Edition (Java EE)
- Java Micro Edition (Java ME)
- JavaFX
Java-based applications that were being used for computer software were developed on the standard edition of Java. Java-based applications for web servers were developed on the enterprise edition while Java-based applications for multimedia platforms were developed on JavaFX. Most JavaFX-based applications are what we usually call flash players. Lastly, Java-based applications for mobile devices were developed on the micro edition Java platform.
Tools for Beginners
In order to begin your journey to the world of Java programming, you need to choose which IDE to use. IDE, also known as Integrated Development Environment, serves as your workspace in writing Java applications. Imagine it as your notepad in writing HTML codes. However, IDEs were specifically designed for the Java language which means it features all the tools you might need in Java development.
Here are the following IDEs that you can use:
- BlueJ this is an ideal IDE for beginners. You can easily navigate due to its simplistic interface. It was also originally designed to help beginners in familiarizing the primary concepts of the Java language.
- DrJava this is a lightweight IDE. Similar to BlueJ, DrJava was also designed for beginners. Although it features a simplistic user interface, DrJava has enough tools that every advanced Java developer can use as well.
- Eclipse one of the popular IDEs today, the Eclipse is an open source platform with responsive navigation and design. Apparently, it has the cleanest user interface compared to other IDEs in this list.
- NetBeans this is another popular IDE which is commonly used in Java development nowadays. This is highly recommended for beginners due to its fast and powerful tools that are compatible in all platforms of the Java language.
Each IDE has a unique user interface and ease of navigation. Feel free to use any IDE where you feel most comfortable with. Keep in mind that all of them use the same language although they may appear to be different from one another.
Aside from Java IDEs, another tool you need to begin learning the Java programming language is the JDK. JDK, which stands for the Java Development Kit, serves as your computers interpreter and compiler for the Java language. Without this, your computer will not be able to translate Java codes into the universal machine language. All versions of JDK are available from the official website of Oracle.
Take note that you need to choose the JDK version that is most appropriate to your computers operating system to avoid future issues when compiling written Java programs.
Misinterpretations
Before we proceed, I would like to clarify that the Java language is not related to the JavaScript language. These are two different programming languages whereas Java is used for the development of stand-alone applications. On the other hand, the JavaScript language is an integrated language for web development. It is used to assert functions that are not achievable through HTML language alone.
This book is about the Java programming language and not about the JavaScript language.
Chapter 1 Writing a Java Program
Once you are done from choosing your preferred IDE and from downloading the latest version of JDK, you now have the tools to begin programming using the Java language. However, having the tools does not mean that you are already prepared to jump into writing your very first Java application.
It is also important to understand the structure of a Java program its primary components and their components in the Java application.
Software Types
You can create two types of software using the Java programming language applets and applications.
Applets are smaller pieces of programming codes that were designed to run on web browsers. We can consider the applets as smaller and lighter applications. They are mainly used to provide either navigation enhancements or additional interactivity to the browser. In contrast with stand-alone Java applications, applets do not need any interpreter in order to execute.
Another type of software that you can develop through Java is a console application. Console applications are stand-alone programs that run within a console environment. All IDEs feature an integrated console environment in order for you to test these kinds of programs. As a beginner, it is important for you to learn console operations to have a good grasp on the basics of Java language.
Classes, Instances, and Objects
The classes, instances, and objects are the three vital elements of a program created using an object-oriented language such as the Java. In order to understand these three, you need to first look at their relationship from one another.
Classes are the highest and they cover everything in Java programming language. Specific elements in a class are called Objects. Once you add the additional specification to an Object, then it becomes an Instance.
In an analogy, for instance, let us say our class here is the animal. Under animal class, we have different kinds of animals like dogs, cats, birds, and so on. These are the objects under animal class. Under the category of dogs, we have different breeds like poodles, golden retrievers, Labradors, and so on. These are the instances of the object dogs.
Project Creation
The first step in writing your Java program is to start a new empty project in your chosen IDE. You can do this by navigating through the top most toolbar as follows: