Pages

Wednesday, March 16, 2022

Getting Started with Java

 Java is an object-oriented programming language developed by Sun Microsystems with the primary objective of providing a development framework that is platform-independent.  This meant that the same code could be executed on computers running different operating systems, something that always required porting.  Oracle purchased Sun Microsystems and is now the company that develops and supports the Java platform.

We will talk about Object-oriented programming in a bit, but first, as a beginner java coder, you will want to start with installing the required software to write your Java code and to execute it.  This includes an IDE (Integrated Development Environment) and the Java SDK (Software Development Kit).  The Java SDK includes that Java Virtual Machine runtime that actually executes your code within its environment.  There are SDK's for most platforms, including Windows, MacOS, Linux, and several other UNIX variants.

There are many IDE's available for Java development with many bells and whistles.  My recommendation, however, is to start with one that is not complicated to install or run.  NetBeans is one IDE that is popular and not too complex to configure, and it is also recommended by Oracle.  Before NetBeans or another Java IDE is installed, you should install the Java SDK.  Most IDE's will require Java SDK version 8 or later.  This can be downloaded directly from Oracle here.

Now back to Object-Oriented Programming (OOP).  The main objective behind OOP, is to make programming easier and faster by reusing code.  Imagine that you had a program that interacted with three balloons, each with different properties (color, size, shape, etc...).  Without OOP, a programmer would have to write the code for each of the balloons to represent all of its properties and actions/functions.

OOP solves this issue by defining classes that can be used to create objects.  So in the example above, a balloon would be the class and the three balloons with different properties would each be created (instantiated) from the balloon class, thereby inheriting all of the properties and functions from the original balloon class.  Every time you create a new object based on a predefined class, you can set or change the default property values.

Computing101.net has a great article on their website going over the concepts of OOP.  The article can be found here:  https://www.101computing.net/object-oriented-programming-concepts/.  Once you've understood the concepts of OOP, I suggest you review TutorialsPoint's Java Tutorial.  It provides some of the basics and examples for beginners.

I hope this has been helpful, and wish you good luck as you embark on your Java development journey.

Cheers!

Hugo



No comments:

Post a Comment