Thursday, March 31, 2016

First Program



Hey guys, welcome to another java tutorial. In this post we're gonna write our first program.

  1. Open your Notepad
  2. OK, let's do coding.


                             public class First{
                                 public static void main(String []args){
                                                System.out.println("Hello Blogger") :
                                 }
                             }

Description

  1. public class First {  -   We started a java class & its name is 'First'.
  2. public static void main(String []args) { -   This is the built in main method.
  3. System.out.println("Hello Blogger") :  -   We print "Hello World" on the screen
  •  Now save it as 'First.java' (save it in Local Disk C or D, trust me unless you'll face lot of problems)
  • Open Command Prompt
  • Type 'cd..'  twice.
  • Then type 'javac First.java '
  • Now type 'java First'
  • Press Enter

1 comment: