Wednesday, 26 June 2013

Introduction to Java

Welcome to our first session of Java Tutorial. This is for those people who are absolutely new to programming. Hope you will like our first session.


Before starting our session let us introduce myself. Of course you know pretty well who I am. But still people who are new to my site can visit About Me page for further details regarding me. I am too interested to know about who you are! So let me know your details by dropping a comment below.

I am a strong lover of C language. But I like Java too. I am programming in Java for the past 6 years. In this mean time I got so many situations where I felt that Java is the perfect language to solve a particular problem. I also experienced some situations where Java was little helpful and I have to shift to my lover C :).

Since this is a online tutorial I just want to confirm whether you are reading each and every word correctly or not. I mean whether you are in hurry or not. Generally people who are addicted to learn via listening will find this tutorial a little bit confusing. But trust me I will make it easy and fun.

This is for just for test. Read the quotation given below only once and identify how many times the letter F is repeated. Remember you have to count the F's by reading the quotation only once.


"FINISHED FILES ARE RESULT OF YEARS OF SCIENTIFIC STUDY COMBINED WITH THE EXPERIENCE OF MANY YEARS"

Now let me know your answer. Anybody got the count 6? I think many of you have ignored the F present in OF. So what is your count?

The above test is just an alert for you to observe each and every word written by me. Actually I may have directly jumped to starting lesson like features of Java, data types and so on. But then there is no difference between books and me. I just want to make sure that you should enjoy programming and don't by heart each and every statement.

Always remember that Programming is nothing but understanding yourself! The more and more you are programming the more and more you are understanding yourself.

Many people try to introduce Java by blaming C and C++. I don't know why this trend is followed by all. For me C is created for separate purpose, C++ is created to solve different problems and Java is created to solve some other critical problems. Actually none of them are interrelated. You can compare the syntax's but you cannot compare and say that Java is a great programming language and C is useless. Still there are plenty of openings in C are there and Java cannot be used in replacement to C.

OK. That's enough of comparing! I have to say lot of things but unable to express all my thoughts via this post because I am new to typing. Please ignore my grammar mistakes but try to highlight my programming mistakes in a program :).

So in order to program in Java basically we need Java software. If it already exists in your system then no problem! But if it is not present then I recommend you to have it via your friends or you can download it free of cost from the official site link Java Download. At the time of writing this post in the official site JDK 7 update 2 is available. By clicking the link a page will be opened and you will find JAVA SE Downloads. Select the first icon. Now you have to accept the license agreement in order to download Java.

Generally we are having two types of systems (OS). 32 bit OS or 64 bit OS. Maximum all the operating systems we are using comes under 32 bit category only. So I recommend you to download 32 bit version Java software. If you are sure that your Operating System is 64 bit OS then go for 64 bit version Java software.

In order to download 32 Bit OS compatible software just click on the link that says Windows x86. Don't worry you are downloading the right version only. 32 bit is not referred as x32 :). It is widely recognized as x86 due to Intel 8086 processor version naming convention.

If you are using Linux operating system then go for either Linus x86 or Linux x64 depending upon your OS.

For Windows OS the Java file size is around 84 MB and it is named as jdk-7u2-windows-i586.exe. If the net connection is slow it will take time. Hence I had provided the download link in the starting session itself so that from the second session onwards you don't need to mess up with all these things. Hope the downloading procedure is clear to you now.

I have already installed JAVA SE 6 or 5 present in my system. Shall I have to download Java SE 7?
If you have already installed or the old version of Java is already there in your system then also I recommend you to download the newest version of Java SE 7 because I am going to cover some features which will not work in older Java versions. Of course I will inform about those features when the time comes.

In order to type your program you need some interface also. The advanced interfaces generally referred as IDE's (Integrated Development Environment). The world famous IDE's for Java are Eclipse and NetBeans. But at this stage I don't recommend you to download Eclipse or NetBeans because as a beginner you will be confused regarding how to use them. And these are actually not necessary also.

You can go for simple file editors like EditPlus or Notepad++ . Even these editors are not necessary at all.

The best way to start programming in Java is via Notepad present in Windows XP or Windows 7 or via vi editor present in Linux. These two editors are built in and you don't need to download any thing at all :). Pretty cool!

If Eclipse, NetBeans, Editplus or Notepad++ are not necessary why are you providing this info?
In order to answer this question I have to mention one incident that I personally experienced. One of my friend attended training session on Java in a famous institute and the institute told that they offer world class training on Java via Eclipse software. They said industry uses Eclipse and not notepad. If you are programming in notepad then it means you don't know any thing at all. They said as a beginner you should go for Eclipse so that you can enter into software industry quickly.

The answer given by that training institute is just a trash. As a beginner if you go for Eclipse you may get comfort in typing but actually the core of language is get hidden and you may not answer even a simple question on how to execute a Java program. So my dear friends believe me you don't need to download any thing except JAVA SE 7.

At present Java software is mainly available in three flavors. They are Java SE (Java Platform Standard Edition), Java EE (Java Platform Enterprise Edition) and Java ME (Java Platform Micro Edition). Previously they used to be known as J2SE, J2EE and J2ME. Java SE is mainly used to develop desktop applications and it is the core of Java. We are going to deal with this only and the link is already provided to download above. Java EE is used to develop server applications and hence in order to learn this you need strong foundation in Java SE. Java ME is mainly used in embedded devices like mobile phones. All the three technologies are widely popular. Of course Java ME is somewhat loosing it popularity because Android (Google product) applications are growing in the market. But still having strong foundation in Java SE will help you to learn Java ME and Android easily.

Java is having one more flavor known as JavaFX. This is still not popular. But we cannot predict its future right now.

Our discussion is only on Java SE i.e. on Standard Edition. Some used to call it as Core Java also. It consists JRE (Java Runtime Environment), JDK(Java Development Kit), JVM (Java Virtual Machine) and many more tools. Don't worry we will see all these one by one. Just be familiar with the names!


Java SE Version History, Code Names and Release dates:

















Java VersionCode NameRelease Date
JDK 1.0OakJanuary 1996
J2SE 1.2PlaygroundDecember1998
J2SE 1.3KestrelMay 2000
J2SE 1.4MerlinFebruary 2002
J2SE 5.0TigerSeptember 2004
Java SE 6.0MustangDecember 2006
Java SE 7.0DolphinJuly 2011

The above table shows the major releases of Java as well as their code names. Please do remember the code names because in some technical interviews they just used to ask you what are the extra features available in Tiger as compared to Merlin? Tiger is just a nick name of J2SE 5.0 then only you can understand what actually the question means. One of my friend just answered that he doesn't know Tiger language :).

If Java is successfully installed on your system then open command prompt (Just press Window Key+R Key simultaneously and in the dialog box type cmd) and type the following command Java -version

D:\N>java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode, sharing)

If you get the above output then it means Java SE 7 was successfully installed on your System.

At this moment the time is sharp 1 AM and I am going to schedule this post for morning 9 AM. Sorry friends I was unable to start Hello World program because there are so many things I want to cover before our starting program. Hope you enjoyed the session.

Let me know your valuable views and suggestions by replying via comments!  

No comments:

Post a Comment