28 April 2020

Introduction to Java


Welcome to the first tutorial of my "How To Code In Java" tutorial series. In this tutorial, you will learn about some of Java's history, how it works, and the use of Java in the real world. Since this might be your first time learning how to code, I'll try my best to explain everything as simple as possible. The structure of tutorial for this series is in this post, check it out if you’re interested in reading the rest of the series. If you find this article helpful to you remember to share it with your friends who are also interested in programming. Another thing is if you do not understand anything in this tutorial, you could use the comment section below to post your question, and I will try my best to answer it. Now let's begin.

Index:



A brief history of Java.


James Gosling, leader of the Java "Green Team", created Java in 1991. Originally, Java was designed for the use of interactive television, but surprisingly, it was too advanced for the cable television industry at that time. Surprising right? A programming language that was initially designed for interactive television turned into a full-blown general-purpose programming language. General-purpose programming language means that we can use it in pretty much all tech domains such as software development, website development, embedded system, and much more.

How does Java work?


Components in Java:



  • Java Development Kit (JDK)
  • Java Runtime Environment (JRE)
  • Java Virtual Machine (JVM)



Java Development Kit (JDK)


Java Development Kit, or JDK is a software development environment to create applets and Java application. It includes Java Runtime Environment (JRE), an Interpreter/loader (java), a compiler (javac), an archiver (jar), a documentation generator (Javadoc) and other important tools needed in Java development.


Java Runtime Environment (JRE)


Java Runtime Environment is a program that is designed to run other software. It contains the Java Virtual Machine (JVM), core libraries and other supporting files. These components will be needed to run Java programs. A library is a collection of code that has been compiled and stored together in a single file. That file when you specified will be linked with your code to give you access to the code in the library.

Java Virtual Machine (JVM)



Java Virtual Machine is the engine that provides a runtime environment to drive our Java code. To run a Java program, the source code files of the program will need to be compiled first into bytecode (.class) files using the Java compiler (javac). Bytecode is a program code that has been compiled from source code files into low-level code designed for specific software interpreter. Bytecode files are platform-independent, means that the bytecode could be executed on any other different operating system computer. The bytecode files will then be loaded into the JVM by the class loader. 

After loading the bytecode into the JVM, the bytecode verifier inside JVM will perform verification to verify for any security issues in the bytecode files. Then, a compiler called Just-In-Time compiler (inside JVM), will take the verified bytecode and using the interpreter inside JVM, convert the bytecode into platform dependents native code (compiled code) that runs on a particular processor. Then our machine can read the native code and begin executing the program instructions.


What can we use Java for?


Now, you might be wondering what can we use Java for, below is a list of application of Java:


Android Apps Development



Java is still widely used for android apps development, even though Kotlin entered the android development market in 2017. The API (application programming interface) used in Android studio was Google's Android API. It's somewhat similar to Java JDK but uses different JVM and different packaging. Java is usually used when developers want to create an android application because it's easy to be used to interact with the native code in android (written in C and C++). Native code means codes that are written for standard/native toolkit and language for a platform. Java developers used software called Android Studio to help them to develop their application more comfortable and faster.


Server Application



We can also build server applications by using Java. Things like bank systems, data processing systems, electronic trading systems, and many more are the few examples of it. Developers usually use Java in the back-end of an application. The back-end of an application is the section where the user cannot interact with or see. It's in charge of the application functionality, not how should the application design be. Java has libraries that let us build computer application from bottom to top such as Swing and JavaFX.


Web Application



Image by Mudassar Iqbal from Pixabay

Java is also used to build web applications using its libraries. Many governments are still using Servlet to develop their web application. Some of the developers also use JSP, Struts, and other technologies to create a web application. Although currently as technologies have become more advanced and refined, there are much more other programming languages that we could use to build a web application more efficiently. But, developing a web application using Java will genuinely let us learn a lot of things regarding web development and how Java works.


Game Development



Games could also be created using Java with the help of frameworks, libraries or game engines. There's a couple of game engine and framework that you could try.


If you decided to try them and got stuck on a problem, all of them has an active community so don't be afraid to ask it on their forum. But make sure to try to search their forum for the answer first before asking one. Although, at the moment, more developer would instead use other game engines and libraries to build their games. Game engines like Unity, Unreal Engine, Cryengine and many more have a huge developer community, not to mention the number of available learning resources for beginners and the number of free high-quality assets that their community provides. But trying to create a game using Java still have its own benefits.


Big Data



Image by Tumisu from Pixabay

Big data are data that is very large, fast or complex that it’s difficult or near to impossible to process using traditional methods. Therefore, special methods are needed to process that amount of data. Luckily for Java programmer, there's a popular big data technology called Hadoop which uses Java. Hadoop enables distributed processing for large data sets across clusters of computers. Since Java syntax is quite a beginner-friendly language, many developers can start using Hadoop if they decided to use Hadoop as they already have experience with other programming languages.

Cloud Computing



Image by Nikin from Pixabay

Cloud computing is becoming more and more of a thing nowadays due to its significant benefits, such as low maintenance cost compared to when companies had to maintain their own server. In recent years, many companies like Google, Amazon, IBM, Microsoft have begun to provide cloud computing services. As Java is one of the top programming languages there is, these companies, of course, provide supports for Java developers to deploy their Java application to the cloud system. 


A bit of word regarding Java


Java is a top programming language which I promise you wouldn't regret learning it. Many big companies like Google, Amazon, and Twitter still use Java in their system. Java will remain around for many years, so why not learn it and add it into your skills set. Who knows one day you'll need it in your job or it let you get a job. That's all for this tutorial, again if you have any suggestion, critics, or suggestion feel free to drop a comment below. Stay tuned for my next article where I'll show you what's the advantages and disadvantages of Java.

No comments:

Post a Comment