Lets get started peeping into what Java really is.Java is a programming language that creates several softwares. The compiled codes are known as Bytecodes.Java is much similar to C++ and C languages. This has a great hand in android and app development. As i stepped into Amrita, particularly CSE, i kept thinking of peeping into coding and learning lots in programming. I knew that it was not like blinking an eye. But i had the patience and strong dezire as i was a begginer. I have also been thinking a lot about android development and app development. Seeing my parts of interests in my bio, one of my senior, Abhilash G (Java and Android developer), talked to me and sketched my dezire. He helped me a lot and gave me excellent introduction on android development. This made me step into Java. I was totally new to it. I googled more about it and also surfed through java documentation. Finally, i took my fingers vibrate to code the basic program in java, “Hello World program”. I have written my experience in java in this blog. Hope you all enjoy it.
After reading and surfing a lot, i started my works. I did not have Java in my in linux. So i installed java 10 in it. Then i wanted an editor to write the code. In this i was a bit confused. I saw many editors like Pico, Atom etc, while i was fogged with just Gedit and Vim. So in installed Atom and installed the script package in it. Then with the help of my senior i learnt about each command and parameters in it.
It was really different from python which i initially knew. I learnt that we use “class” defenition and it is assigned a name. Every code in java begins with a class command.A class includes Modifiers (public/protected/private) , a Class name, Key words and the Class Body which is within curly braces. Public, the commonly used one exposes a class to other classes too. While private hides from other classes. Then we write a name for the class. There are 50 keywords in java. Being the key words they cannot be used as variable names.Then comes the main body of the program.
Coming to the second line of code. This line has a main method and its signature is as follows:
public static void main(String arg)
The main method gives the Main part of the program. It includes the string and the argument given by “argv” or “args”.The next step is to give the output. This has the following signature:
The program now gives the output. We can also give certain comments for the code wherever required. this can be done by the following way
/** this is my HelloWorld program in java. I am a learner in java.*/
There are certain thing that one has to keep in mind while saving the java file. Its recommended to save the file in the same name as that of the class followed by .java signature.I have done my code using Atom editor.
This experience of java was really thrilling and good. This becomes much more interesting when you have such a good guidance as i got from my senior mentioned above. And it is real fun to write and learn the codes in Java.