Being an Oracle Certified Java Programmer


In this post I will explain my experiences in taking up OCJP exam.


The Oracle Certified Java Programmer exam mainly tests the individual's basic understanding and knowledge of the Java Language.It consists of many questions on Object Oriented,Syntax and Structure based questions in multiple choice type and Drag and Drop questions.



                                                              

Inheritance in Java

In the previous posts you have learned about the Object Oriented Programming(OOP) Principles( you can refer them here ).So,one of the brightest theories of OOP is the inheritance,we can use the information by acquiring from one class to another and in this way we can manage our data in a hierarchial order.

Mainly we can use inheritance in Java by using extends and implements keywords extends use mainly normal single inheritance where as implements is used for multiple inheritance which cannot be implemented directly in Java using extends keyword.

So,in Java we have two relationships in Inheritance.They are :
  1. IS-A relationship.
  2. HAS-A relationship.
  • IS-A relationship : We can explain the inheritance actually like,eg: Dog IS-A Animal , BMW IS-A Car.Here we have a simple example.
class Animal{
}

class Dog extends Animal{
}

class Cat extends Animal{
}

public class Kitten extends Cat{
}
         
Now based on above we can come to these conclusions:

  • Animal is the superclass of Dog and Cat.
  • Dog and Cat are subclasses of Animal.
  • Kitten is the subclass of Cat and Animal.
These conclusions can be mentioned in IS-A form as:
  • Dog IS-A Animal.
  • Cat IS-A Animal.
  • Kitten IS-A Cat.
  • So,we can say that Kitten IS-A Animal.
We can explain this with the help of an example program.

public class Kitten extends Cat{
   public static void main(String args[]){

      Animal a = new Animal();
      Cat c = new Cat();
      Kitten k = new Kitten();

      System.out.println(c instanceof Animal);
      System.out.println(k instanceof Cat);
      System.out.println(k instanceof Animal);
   }
}

Here we can see that Kitten class is creating objects for Animal ,  Cat , Kitten classes.We are testing whether Kitten object is an instance of Animal and Cat by using an instanceof operator.We will get the output as:


true
true
true


So,here we covered the inheritance with extends keyword,we will see implements concept in detail in Interface concept.



  • HAS-A relationship : The HAS-A relationship mainly deals with the usage of a certain code used in one class which is extended from an another class.In other words,if a class Vehicle has a subclass class Car and class B has a variable called myBrake which belongs to Brake class,then we can say Car HAS-A Brake.
This can be explained in the below code:
public class Vehicle { }
public class Car extends Vehicle {
      private Brake myBrake;
}


We can also see examples like:

  • class Room { .... }
  • class Bathroom extends Room{ private Tub myTub; }
So in this we can see Room is a superclass,Bathroom is a subclass which has a Tub instance variable so we can say a Room HAS-A Tub.


So,in this way we can explain the inheritance concepts.The main advantages if Inheritance are Code Reusability and ability to support polymorphism.


In the next posts more and more concepts will be covere,Stay Tuned!!


Au Revoir!!

Cloud Computing Explained!


  • What is Cloud Computing?



     Cloud Computing is one of the famous buzz words and the hype in the present day software industry.So, what exactly is Cloud Computing ? Do we need to travel in an aeroplane or sit on top of a mountain with a computer to leverage the services? Does it work when it is raining ? ;) ( I came across a video in YouTube where an IT Commissioner asked this question :D ).The answer is obviously NO.I will try to explain about Cloud Computing in this post without too many technical terms and in an easy understanding way.
                                          

  • Cloud Computing can be described as the modern day Internet Computing and it is mainly enabled by virtualization and we can say it is an adaption of virtual computing ,because everything depends and runs on the Internet!Imagine you have a website and you started promoting it and by god's grace it has clicked and you got some huge amounts of traffic.So,obviously you have to maintain your web-server with increase in your site's popularity.There may be one state where you may fail to maintain your server as  effectively and as consistently compared to the earlier times,which may result in less number of hits for the site,many people may find difficulties in accessing your website and many other problems.One solution is to buy more and more number of servers which involves increased cost and maintenance.
  • Take an other scenario , where your company has a website which attracts seasonal traffic from the public like an examination results portal.There will be huge amounts of traffic when the results are out and to handle that traffic the company must buy more servers but in the rest of the time the site doesn't get too much attention.So , the company need to pay for the server and its maintenance even though there is not much traffic. We just cant throw away the servers once we buy and set them up and running.
  • Cloud Computing provides easy solution for the above problems decreasing the cost of setting up and maintaining the servers , site and application of an end-user/organisation.


source getty images
                                                  
                                                

  • Cloud computing involves sharing of  many computer resources like software,servers etc;which are useful for the software development.These resources are shared between the computers all over the world by using the data centers which will be accessed through Internet and is known as "Cloud".There are many organizations which call themselves as Cloud Service Providers( Google,Amazon,Microsoft,vmware etc) which provide these infrastructure and software in the form as a service through Internet or as we call in this context Cloud.The main idea of Cloud Computing is we outsource our application/web site to the Cloud Providers and use their infrastructure to run our applications.
  • So how can a cloud service provider help solve the above problems for an organization?

    Cloud Computing follows some important capabilities which help solve the above problems:
    1.Elasticity : As the name suggests it means being flexible, when your application needs to serve the traffic which needs 100 servers the cloud can scale up and give access to 100 servers at peak time and if you need only 1 server to just keep the site running without any huge traffic you will get only 1 server. You cant get this kind of flexibility or scalability when you are hosting the application/ web site on your own.

    2.Pay-As-You-GO: So previously you bought 10 servers to maintain the traffic for your website which will last for only 2 months and in the rest of the year you just need 2 servers to maintain the website leaving those additional 8 servers ideal. Cloud computing solves this problem as you can pay for only the number of servers or computing resources you are using i.e. Pay for only 2 servers when your site is getting less traffic and 10 servers at peak time. This is just like paying for a Cab or Electricity , when you want to go somewhere you hire a cab and pay for the ride depending on the distance traveled,and you pay for the electricity as per your usage.

    3. Self Service and Instant Access( ON/OFF): When you want to setup the servers on your own you buy the infrastructure and take some time to get them ready.But in the case of cloud-computing, the cloud providers will give the access to the cloud through a terminal or console which we can access through our computer. You can instantly order the computing power when you are in need and just turn them off like an electric bulb when you are done.

    These are the main reasons why the cloud computing became so huge recently. Hope this makes sense till now. But you may ask what does cloud computing mean to me? How it is helpful ? The answer is, it takes many forms and is helpful depending on what your need is.



  • If you are a Business Professional or System Administrator : Cloud computing is all about outsourcing your application and data to utilize the computing power like infrastructure, hardware, servers etc; You move away from the servers you are paying to maintain the website and access the infrastructure of the cloud provider. This is called Infrastructure as a Service ( IaaS ). You will be billed according to the number of CPU hours and the usage of the website. Majority cloud providers in this domain are Amazon Web Services (which provides many services like Amazon EC2 and S3), Google (Google Compute Engine) , Microsoft (Azure), Red hat  vmWare etc;
  • If you are a Developer or an Architect : You need to develop applications or think of a strategy to migrate the existing in-house applications to scale and to leverage the service of cloud. All you need is a platform(Java, .Net , PHP , Ruby etc). Providing this is called as Platform as a Service ( PaaS ). This service will provide a Platform and a set of development tools knows as SDK to develop or migrate applications to leverage the cloud services and infrastructure. The major provider in this service are Amazon(Amazon Web Services Elastic Beanstalk), Google ( Google App Engine), Microsoft Windows Azure, Heroku, AppHarbour,CloudFoundry etc; If you are a developer these services provide some exciting features. All you need to do is download the SDK from the site, write some code and deploy that to the server.Voila!! You can access your application anywhere in the internet! Its that easy.
  • If you are an End-User : You need a variety of application in your day to day life. But in some situations you may need to worry about many things to access that applications like the application may not run on your hardware, you cant access your application data in another device or at your workplace.So instead of buying the software and installing it on your device, you can purchase a monthly,weekly or yearly subscription of that application and access that application on your web browser without worrying about your hardware. You can use it on your PC when you are at home, on your laptop when you are at your workplace, on your mobile phone or tablet well where ever you may be. This is called providing Software as a Service ( SaaS ). For example, instead of buying Microsoft Office license and installing it on your computer you can just simply use Office Cloud365 service provided by Microsoft by paying monthly subscription as per your usage. One major advantage is you can use the brand new versions of the software with updated features every time unlike the software you bought for some huge money.
                                                               
                                                       
Not only these services there are some new Service Models coming in to the market like Gaming as a Service, Backend as a Service, Network as a Service which I think will fall under one of the above mentioned categories when you think logically. 

One of the major disadvantage and challenges of Cloud Computing is providing security. No one will give  the important customer data of an organisation to a 3rd party cloud provider without knowing how secure will be the data. This is the major challenge which needs to be addressed in case of very large organizations. The other alternative is to set up your own Cloud and be your own Cloud Provider. Here comes the concept of different models of Cloud.
a. Public Cloud - Here you outsource your application to a big cloud service provider who can afford huge amounts of money to buy and maintain servers to run many applications in their data centers.This type of cloud is called Public Cloud.
b. Private Cloud - Here an organization can set up its own infrastructure i.e. its own cloud by setting up virtualized instances of the servers.One more thing is to consulting 3rd party vendors to setup your own network through internet. This may sound similar to Public Cloud IaaS offering but here we get this service under the organizations firewall restrictions.

These concepts are pretty complex and are worth explaining in an other blog post. I hope this post was helpful for people who struggle to understand what Cloud Computing really is!!
                                        

Listen to your MP3 songs on your PC through Java MP3 Player!!

We all listen to songs daily in our PC,majority of them or all of them are mp3 formats.We have different kinds of Media Players in Internet.But,regardless of all those applications if we use a Media Player made with Java,how it will be?


Sounds Intresting right?


Two years ago when I am searching through java websites I came across this intresting application called Java MP3 Player.Even though its not very userfriendly,its a very good application which is developed using basic Swing capabilities. 


                                                  
You can see the source code here :
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package mediaplayer;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
import javax.swing.*;
import javazoom.jlgui.basicplayer.*;
/**
 *
 * @author Administrator
 */
class JavaMediaPlayer extends JPanel implements BasicPlayerListener{

    private JProgressBar jpb;
    private JButton play;
    private BasicPlayer player=new BasicPlayer();;
    private String imagePath="images/";
    private static int p=0;
    private static boolean playBoolean=true;

    JavaMediaPlayer(){
        //setLayout(new FlowLayout(FlowLayout.LEFT,3,3));

        setLayout(null);

        player.addBasicPlayerListener(this);

        play=new JButton(new ImageIcon(imagePath+"pause.png"));
        play.setToolTipText("pause");play.setBounds(2,2,20,20);

        play.addActionListener(new ActionListener(){
           public void actionPerformed(ActionEvent ae){
               if(playBoolean){
                   pausePlaying();
                   play.setToolTipText("Play");
                   play.setIcon(new ImageIcon(imagePath+"play.png"));
                   playBoolean=false;
                   return;
               }
               if(playBoolean==false){
                   resumePlaying();
                   play.setToolTipText("Pause");
                   play.setIcon(new ImageIcon(imagePath+"pause.png"));
                   playBoolean=true;
                   return;
               }
           }
        });

        jpb=new JProgressBar();
        jpb.setBorderPainted(true);
        jpb.setBounds(25,2,280,20);

        add(play);
        add(jpb);
    }

    public void startPlaying(String fileName){
        try{
            play.setIcon(new ImageIcon(imagePath+"pause.png"));
            play.setToolTipText("Pause");
            playBoolean=true;
            player.open(new File(fileName));
            player.play();//actually play file
        }
        catch(Exception d){
            System.out.println(d);
        }
    }
    private void pausePlaying(){
        try{
            player.pause();
        }
        catch(Exception e){
            System.out.println(e);
        }
    }
    private void stopPlaying(){
        try{
            player.stop();
            jpb.setValue(0);
        }
        catch(Exception d){
            System.out.println(d);
        }
    }
    private void resumePlaying(){
        try{
            player.resume();
        }
        catch(Exception d){
            System.out.println(d);
        }
    }

    public void opened(Object arg0, Map map) {
        String k=map.get("audio.length.frames").toString();
        jpb.setMaximum(Integer.parseInt(k)-15);
    }

    public void progress(int arg0, long arg1, byte[] arg2, Map map) {
         String s=map.get("mp3.frame").toString();
         int k=(p-(Integer.parseInt(s))*(-1));
        jpb.setValue(k);
    }

    public void stateUpdated(BasicPlayerEvent bpev) {
       if(bpev.getCode()==BasicPlayerEvent.STOPPED){
           // Something here
       }
    }
    public void setController(BasicController arg0) {
       // throw new UnsupportedOperationException("Not supported yet.");
    }
}

This is the JavaMP3Player class.The following code is the Main class.
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package mediaplayer;

import javax.swing.*;

/**
 *
 * @author Tutorial Jinni
 */
class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        JFrame f=new JFrame();
        JavaMediaPlayer jmp=new JavaMediaPlayer();
        f.add(jmp);
        f.setDefaultCloseOperation(3);
        f.setVisible(true);
        f.setSize(330,60);
        f.setTitle("Java Media Player - Tutorial Jinni");
        jmp.startPlaying("Song-location.mp3");
    }
}


You can execute this first by grouping both these classes in a single folder,compiling the Main class and try executing it.This application mainly usef JMF(Java Media Framework) which is used to create Players and several other media related applications.


In this,we used BasicPlayer class and applied some techniques of Swing!


You can download the program full source code here .To execute this full source code you need NetBeans Developer IDE.


We will see more Java Applications in my next posts!!


Hope you liked it!


Stay Tuned!!






                                    

Samsung-Android Galaxy 5


Samsung announced Galaxy Android 5 series phone with more unique qualities than the 3 series.I came across this phone recently and I decided to write a review on what I saw.
       


This Samsung phone powered by Android platform has a unique Samsung Social Hub facility.In this we can get all the contact details and emails from an user's social networking site into a single contact list,making it more easy for young professionals and teenagers to keep in touch with their friends.You can easily share your day to day updates with youfriends all over the social networking sites at once.


It has many more in-built features.They are:

  • This Mobile comes with Android 2.1 OS
  • TFT LCD Display with 2.8'' 240x320 pixels.
  • 2MP camera with LED Flash.
  • Google Mobile Service,Android Market,Touchwiz 3.0.
  • Wi-Fi, Bluetooth 2.1, A-GPS .
I think this phone is a very good option for youngsters and social networking geeks as it comes in affordable range of Rs.10,000 in the market!!








                                             

Java Applications-Local Raja for Hyderabad MMTS Train Timings

Hello again,in the previous posts we saw actually what is java and its features and basics.Now Im going to dive into some other topic which deals with applications of Java.As I said earlier Java can be used every where in our daily world ranging from mobile phones to microwave owens.

                                          

Coming to the actual topic,MMTS railway stations and trains are rapidly gaining popularity these days.Everyone are opting Local Metro Rails rather than buses as they are  far more cheaper and  takes less time to cover the distance across the city of Hyderabad.As I am a frequent user of Local Trains when I am browsing through Internet usually, I stumbled across an AWESOME JAVA APPLICATION called as Local Raja.This application is mainly used for keeping track of the timings of Metro Rails which are very frequent in twin cities.It becomes very cumbersome for a person to memorize all the train timings starting right from 4'o clock in the morning to 10'o clock in the night.

As now a days,we can observe every 90 persons out of 100 are having a Mobile,it became a necessity rather than an accessory.So I think this  simple Java application will be helpful for those who are using LocalTrains frequently

This application comes as two .jar(Java archive) files.These can be uploaded into your mobile using your datacable and you can access them whenever you want!!

You can download this application here .

Hope this application is useful to some of you!!

Stay Tuned for more intresting Java tutorials and Applications.

Au Revoir!!


Variables and Datatypes

Variable and its Scope


There are mainly 2 types of variables in Java.They are: Instance variables and Member Variables(Class variables).


Instance Variables are the variables which are created while instantiating a class.


Class variables are the normal variables which are declared casually inside a class.


Note : The static variables also come under class variables.


Datatypes Explained


In the previous section we came across the various datatypes and its categories.Lets have a deep look at them.



  • Integer Datatypes(int,byte,short,long) are used to store signed integers values.The memory size of the datatypes of byte,short,int,long are 1,2,4,8 respectively.
          Note : A long literal is generally ended with ' L '.Ex: 32L.
  • Floating Point Datatypes(float,double) are used to store the decimal type(fractional type) values.The memory size of the datatypes of float,double are 4,8 bytes respectively.The floating point literals float must end with ' f '.And double literal must take a precission of two places or else there will be a Loss In Precesion Error by compiler.
          Example : 2.8f - float literal.
                         2.85 - double literal.
  • Character Datatype(char) are used to store single Unicode characters.The memory size is 2 bytes.
  • Boolean Datatypes are used to store the values which are either true or false .

Video tutorial:

So,we covered the Language basics till here and from next parts we will go into the more serious parts which are useful in coding.

Stay Tuned for more posts!!

Au Revoir!!




Java Language Basics

In the previous posts we saw the basics of Object Oriented Programming , and Demo Java Programs.Now its the time to dive up into the Java Language Basics.Java language basic means the whole theory wound up around the object,so lets start with the objects and variables.


Object Instantiation
An object as quoted in my early posts is a real world run time entity.It can also be defined as an instance of a class.


In easy words instantiation is not but creation or representation.So,we will see just how to create an object.By creating an object you can access the members and methods of a class.


We generally create an object for a class say Sample,then the object is represented as : 
                                   
              Syntax : ClassName <reference variable> = new Constructor;                            


              Example : Sample s  = new Sample( );


Here Sample is the class-name , s is the reference variable and Sample() is the constructor
Constructor is defined as the block of code which is initialised whenever an object is created.


So,what actually happens when you create an object.If you observe carefuly we are using a dynamic memory allocation operator known as new here which allocates the memory for the created object.Here we will store all the member variables and the method values.


If we create multiple instances for a class we give different reference variables while instantiating.


           Example : Sample s1 = new Sample();


Accessing the members of the class by using an object


Now, we created the object.We should know what to do with the object and how to access the members by using the object.


We can access members of a class by using an object by using the DoT operator( . ).


             Syntax : <reference-variable>.classVariable;
                         <reference-variable>.classMethod();
  
             Example : s.width;
                            s1.width;
             Example : s.myMethod();
                            s1.myMethod();


Tokens


Tokens are the smallest elements in the Java program.These tokens are determined into several types.We will take a brief look over the list.So, they are : 



  1. Identifiers : Any names which are provided by the user.In Java identifier can be of infinite-length. In th declaration int a , b, c; (a,b,c) are identifiers.
  2. Keywords : Java provides 60 keywords,which are used while programming.We will come to know as we dig deep into the Java Language.
  3. Literals : These are the elements used frequently in the program.They can be divided as Numeric Literals and Character Literals(Boolean Literals).We will see this Literals once we cover the last token Datatypes.
  4. Operators : These are the elements which are specially used for the evaluations of the variables.Java supports wide range of Operators.
  5. Seperators : These are used to end ,interept or join two statements in Java.In simple words,it will inform the Java compiler how to group the statements and the code(If you want more detail explanation,better go and refer Compiler Design( :P ) ).
  6. White Spaces : Not very tough to understand isn't it?
  7. Data Types : These are the stroage structures of the variables.Every variable is associated with a Datatype in Java.
             There are mainly 2 types of Data types.They are :
  • Primitive or Non Reference Datatypes :byte,short,char,boolean,float,int,double,long( ordered in ascending and alphabetical order)
  • Reference Datatypes : Class type, Interface type,Array type,String Type.
                  We will deal with this in depth and detail when we are discussing the variables.i.e;in the next post.Stay tuned till then! Au Revoir!!

Object Oriented Programming Basics

In the previous posts we have learned about the Characeteristics of Java (Refer here).One of the characteristics are Java is  Object Oriented Programming(OOP's) Language.


Now before we take a dive into Java language we have to know the basic OOP's.



  • Object Oriented Programming is the technique to create programs based on the real time entities like objects and data.We can summarize it as the way of real world modeling.
  • Unlike procedural programming here the programs are constructed around objects and data.
  • Objects are the basic real world runtime entites which have certain behaviour,properties,type,and identity.
Fundamentals of OOP

Before understanding Java we must understand OOP and its basic features.They are: 
  • Class is the central point of OOP and it is collection of objects and data and methods exhibiting certain kind of behaviour.In the classname every word must start with a "capital letter" Ex: HelloWorldJava.
        Example: public class Box{
                                  // your code here
                                  /* This is a basic class with data and methods.
                      private int a;
                      private int b;
                      public void setValue(int width){
                             a = width;
                      }
                      public void setValue(int length){
                             b = length;
                        }
                      public void displayValues(){
                               System.out.println(" width is " + a " length is " + b);
                       }
                         }
  • Objects are the basic unit of OOP and basic runtime entities expressed as variables and methods.
  • Methods in Java determine the behaviour of the object.The methodName must start with a ''lowercase letter'' and the preceeding word in the method name must be a "capital letter".
         Example : public void displayValues(){ 
                        //your code here.
                        }
  • Abstraction is the process of hiding the unnecessary or secret details and exposing the essential features of an object.This concept is mainly used by classes.The above image shows the abstraction of a Car class which hides the unnecesarry details and exposes the details like Change gears,Brake,Change cadence.
  • Encapsulation is the ability of an object to bind the data and methods together.The Accessor and Mutator methods exhibit encapsulation.The above image also demonstrates the Encapsulation process.
  • Data Hiding is the ability of the objects to shield the variables from external access.
  • Polymorphism.Let us make this straight.Polymorphism is the ability of an object to take one or more forms.
         Polymorphism can be achieved by Overloading(method and operator) and Overriding( method).

   Using the above diagram we can explain the concept easily.Here we have an Animal object which is classified into Dog,Duck,Cat which have different behaviours like doWoof for Dog,doQuack for Duck,doMeow for Cat.This will be explained in later posts in detai.
  • Inheritance is the capability of a class to use properties of other classes by extending its features.The main idea behind the Inheritance is the code reusability.i.e. If I declare an Animal object it has methods like animalName(),animalSound().

        If I want to write code for a Dog object then instead of writing all methods I can simply use the above code and methods by simply extending the Animal Class.This is known as Inheritance.

These are the basic fundamentals of the OOPs.

I found a nice video on YouTube on OOPs and here it is :



In the next posts we will dive into the Java Language Basics.Stay Tuned and Au Revoir!!





                    

Hello World App

Creating you First Java Application.


Hello again,here now we will deal with how to create a simple Java Hello World App which displays the message "Hello World!".To create this program, you must :

  • Create a Source file : The source file contains all the code of our program written in Java.You can generally use a text editor like Notepad for creating the source file.After writing the code just save it in the .java format.Example: Sample.java
  • Compilation of the Source file : Now the created source file(Sample.java) must be compiled to generate the ByteCode.It will be compiled by javac compiler which can only be understood by Java Virtual Machine(J.V.M).The command for compilation is javac Sample.java
  • Run the java file : The java application can be executed by J.V.M by using java command.The command for running the file is java Sample.

Creating a source file

To create a source file , just open the notepad and type the following code:

HelloWorldApp.java :
/**
 * The HelloWorldApp class implements an
 * application that simply prints
 * "Hello World!" to standard output.
 */
class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!");
        // Display the string.
    }
}

Then, save the file as HelloWorldApp.java and exit NotePad.


Compilation of the Source File

Bring up the command prompt and navigate into the source file location.

Then,type the command
  • javac HelloWorldApp.java
Run the Java File
To run the Java File,after compilation you can see the output by typing the command.
  • java HelloWorldApp
Explaining HelloWorldApp
  • The HelloWorldApp source file contains Multiple line Comments which are useful in the development phase of the program.Its a good habit to Comment your programs as it is useful for others to know about your program.
  • HelloWorldApp class begins with the keyword class(A brief explanation will follow the next posts) which is embeded between the two curly braces " { } ".
class HelloWorldApp{ }
  • Main Method is the essential method for every class.It is the entry point into the program.It is named as "public static void main(String [ ] args)".The main reason behind this is:
-> Why main must be declared as public?
A). main() is invoked by JVM(i.e. J.V.M will access the main() method in our class)As JVM is outsider,it does not belong to our program package.So,inorder to access main outside our program we declare it as public.Or else we will get a compilation error known as main method not public.
-> Why main must be declared as static?
A).If a method is declared as static in the class we can call it with using classname.methodName(); So in order to call the main method it must be static.
-> Why main must be declared as void?
A). A void keyword means it returns nothing.JVM expects nothing when calling the main method.So it is named as void.
This sums up the introduction to the basic Java Program.
This is the introductory Hello World App.Stay Tuned for more Tutorials!

Au Revoir!!

Introduction to Java



Internet, is the world wide network of computers.It mainly connects millions of computers all over the world.So these millions of users have many different types of computers , operating systems with different architecture , accessability.So,there is a huge need for a programming language which is suitable for all these requirements.



  • At this moment ,Sun Microsystems,Inc. designed a programming language called Oak by James Gosling and Patrick Naughton which is renamed to Java in 1995.
Java mainly ignores the barriers between different computer chips and operating systems.Your applications wil become compatible with all kinds of operating systems and types of computers.

Java is used everywhere.Right from your mobile phone to the computers.
  • How Java Works?
        The Java code is generally compiled by using a javacompiler(JIT).The compiled code is known as ByteCode.This ByteCode can be executed in any platform irrespective of the architecture,compatibility,power and capacity.


This ByteCode obtained from the compiler is executed in the Java Virtual Machine(J.V.M) which is the Java run time system which also acts as an interpreter for the ByteCode     .      

Characteristics of Java       
  • Simple.
  • Object Oriented.
  • Distributed.
  • Interpreted.
  • Robust.
  • Secure.
  • Architecture Neutral.(Platform Independency)
  • Portable.
  • High Performance.
  • MultiThreaded.
  • Dynamic.
Closer Look at Java Source File

     A java code is written mainly in the text editors or an IDE(Integrated Developer Environment).If you are at learning stage I suggest you to start with a text editor like Notepad,EditPlus,etc;


  • Java Source File is categorised into four sections.They are:Package section,Import section,Class/Interface section,Comments which are further divide into Multiple Line Comments and End of Line Comments.You can refer the above picture to make it clear.
Here is a small Video on Basic Java Development to wind up this post.

Hello World Program!







Hello World!!

Hello World!!


This is Sai Subramanyam!! I am a student doing my B.Tech in Computers.I am a Java geek and enthusiast.I created this blog to share the stuff I know and to update this blog with variety of Technologies available.