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...

Windows 10 is good but!

Microsoft's latest attempt at staying on top of the desktop OS market, Windows 10 has been successful to say the least. The operating system was built on the stability of windows 7 and the desktop/mobile hybrid OS, windows 8 styled retro UI. The result is great but somethings puts me off about the operating system. My experience so far with the OS has been good but not great. I'll try to analyse some of the turn offs of windows 10 as I have experienced. I know there may be some out there that have had my kind of experience. #1 Boot time. Microsoft has boasted of a faster boot time on windows 10 but that may not be the experience with all PC configurations. The fast boot is merely hibernation in disguise. In hibernation, your PC resumes exactly where you left it by dumping your last state on your hard drive and at boot time the dumped file is read back into memory and work continues where you left it. With windows 10 fast boot, core system file that loads every time you b...

Android MTK Device Tutorial: Fixing invalid IMEI error

So, after doing a factory reset of my Infinix Hot Note, I ran into an invalid IMEI error which means no network connection for calls and data. Thankfully I fixed it without breaking any sweat. Here is what I did with step by step tutorial. This should walk on any android MTK device as I tried on Infinix HOT Note X551 1. GET YOUR IMEI NUMBER Check the back of your phone after removing the cover, look on the battery, your IMEI should just be right there. Copy it by writing it on a piece of paper OR  Head over to  https://dyrk.org/tools/imei/  to generate a random IMEI for use. 2. THE PROCESS  For this method, you may need MTK Engineering Mode App from the Playstore (Note: Since IMEI is corrupt you will have no internet connection except you connect to a WIFI Access point).  You may also dial *#*#3646633#*#* in the dial pad if this work for you without having to install MTK Engineering tool (I doubt that!) Open MTK engineering mode app you inst...