Skip to main content

JAVA: First program

Lets create a simple program.

JAVA PROGRAM:
class myfirstprogram{
  public static void main(String args[]){
  System.out.println("Hello World");
  }
}

OUTPUT: Hello World

Explanation:
class keyword Javaprogram name of the classopening of the class
  public access key static used for calling without an object void doesn't return a value main name of the method (String args[]) argument to the methodopening of main
  System class in java.lang package.out field.println object("Hello World");
  } closing of main
}closing of class

When we compile the program, the compiler compiles and creates a .class file.
When we run the program, Java Virtual Machine(JVM) loads the .class file.
Here, Java converts all the contents of source file to byte code thats the reason we get a .class file after the compilation of the program.

PREVIOUS                                                                      NEXT

Comments

Popular posts from this blog

I Wish for a WISH

Wish I can wish for a chance A chance to win A chance to be better   A chance to be the best daughter But I don’t want to regret a thing Am happy the way I think The only thing that I wish Let me be me please. I don’t want to hurt anyone I don’t want to lie I just want to see everyone happy The only thing that I wish Let me be me please.                                                                                                          ...

Fantasy Dream Poem

How nice it would be, If we can dance over the rainbow, Sleep over the clouds, Shine with the stars, And bless others with the raindrops. I know it’s a fantasy dream, But nothing is impossible!

First Love

When I first saw you, I felt my own heart beat, When I first talked to you, I felt the butterflies in me, When I first met  you , I felt like i found ma life, When I feel in love with  you , I saw my future with  you , But all those were mai thoughts, Cause  you  didn't love me at all, I thought  you  loved me, Until I saw  you  wid her, Doing whatever  you  did with me, All my feelings went away, It felt like a glass broke down, It still hurts, I hope tht  you  wud stay happy, I hope that  you would  live , All I want to see is you being happy.                                                       ...