iPhone – HelloWorld program in java..

Welcome to the java world.This is an simple HelloWorld example.

If you are new to programs ,Basic Terms you should know before the code:


Class is an collection of objects.it is an wrapper for the objects.

Example:Classroom(Classroom contains benches,boards etc)


Everything is considered to be an object.Especially in java everything is an object.Remember java is used for platform independent and real life entity mapping too.



Method is a collection of code which are called to do a specific task.

Example:Brakes in a vehicle…


Variable are used to store values which are used later for computations.



public class HelloWorld {

public static void main(String[] args) {




public class HelloWorld {

  • HelloWorld is the class name and its access specifier is public so it can be accessed from any other classes.

public static void main(String[] args) {

  • Here public is the access specifier so the is accessible for other class.
  • It is static so it has only single memory.
  • void is the return type of this method so the method wont return any values.
  • String[] args is the parameter passed to this method.


  • This line prints the value ‘HelloWorld’.
  • Here println() is a method.
  • out is an object.
  • System is a class name.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s