Skip to main content

Intro to JAVA programming language - Beginners Series to JAVA

I welcome everyone who has stopped by to view this post. My main desire for starting this series of JAVA programming tutorials is to breakdown to the simplest form the concept of programming in JAVA or any other language. Here our focus is on JAVA but the concepts to be learnt here will be keys to learning and programming in object oriented languages as JAVA is mainly an object oriented programming language.

I wont talk too much on object oriented programming but here is a little tip as i understand it. Most tutorials introduce you to programming in any language by showing you how to print a string to the screen but i would like you to understand the basic object oriented programming concept before we start typing in strings.

Objects as they are can be compared to the objects you see in your everyday life. What you see and make use of in your day to day life are in categories. For example, cars. Cars are cars everywhere but there are models from different manufacturers; Ford, Mercedes, Toyota, etc. These manufacturers build cars having different designs, functions, performance and so on. In object oriented programming a class is defined and other objects can be created from the class in a concept called inheritance.

The car class will have some attributes that are common to cars such as, headlamp, tyres, number of passengers, speed, etc.

Objects can now be created from this Car class that will have all these attributes in addition to specific attributes to that object, for example, the ability for the car to auto brake in certain conditions. An object inherits from its super class which inherits from its own super class. See this illustration.

Basic Inheritance

If you look closely at this illustration you will see that we can add another super class before the models that we can call brands: Toyota, Mercedes, Chevrolet, Ford, etc. These will now have object called models according to the categories.

If you can really understand classes, objects and inheritance you would have gone half way in learning object oriented programming, hence, JAVA programming language.

Now to Hello World JAVA!

You don't need much to start coding in JAVA other than a text editor and your Windows command line, MacOS terminal or Linux Shell/Bash.

I however will be using IntelliJ Idea: a fully packed Integrated Development Environment for JAVA and other languages. I wont cover how to download and install that here but you can head over to
IntelliJ IDEA's official download page and download the Community edition which is free to use so that you can easily follow along.

//Pls note that you also need to download the latest JAVA JDK for your operating system from Here.

Having installed IntelliJ and JAVA, head over to File -> New -> Project to start a new project.
You will have to specify a package name using your url in reverse order like this org.myurl.java.

//A package name in JAVA is just folder structure

If you have done everything right you should see something like this screen below;


Just type System.out.println("Hello Java!")
after where it says write your code here and you should see Hello Java! or what ever text you enter between the double quotes printed at the command window below the edit screen, yes you have just written your first JAVA code.

See the next part of this lesson Here

Comments

Popular posts from this blog

Complete CorelDraw Shortcuts

For Corel enthusiasts out there; here is a list of shortcuts in your favourite design/illustration app to make you work faster. Learning this may not be that easy but with continuous practice you should get used to them. Enjoy! Align Bottom   B   Aligns selected objects to the bottom Align Centers Horizontally   E   Horizontally aligns the centers of the selected objects Align Centers Vertically   C   Vertically aligns the centers of the selected objects Align Left   L Aligns selected objects to the left Align Right   R   Aligns selected objects to the right Align To Baseline Alt+F12   Aligns text to the baseline Align Top   T   Aligns selected objects to the top Artistic Media   I   Draws curves and applies Preset, Brush, Spray, Calligraphic or Pressure Sensitive effe Back One   Ctrl+PgDn   Back One Break Apart   Ctrl+K Breaks apart the selected object Brightness/Contrast/Intensity C...