It is the time to move in programming now .After learning the feature of java the next step of java learning is to understand the art of program writing.Here we will go with the simple program and will see how to write a simple program.
================================================================
|| public class hello ||
|| { ||
|| public static void main{String args[] }throws Exception ||
|| { ||
|| System.out.println("hello this is my first java program"); ||
|| } ||
|| ||
================================================================
System is in class java.lang package which comes with jdk by default hence we need not have to include import statement
In System class "out" is a staticvariable for print stream class
in print writer class print() and println() methods are given that they can print any type data type valueit may be an byte short word int long float double char etc.
====================================================================
To compile the above program
javac hello.java
To run the above program
java hello
================================================================
|| public class hello ||
|| { ||
|| public static void main{String args[] }throws Exception ||
|| { ||
|| System.out.println("hello this is my first java program"); ||
|| } ||
|| ||
================================================================
System is in class java.lang package which comes with jdk by default hence we need not have to include import statement
In System class "out" is a staticvariable for print stream class
in print writer class print() and println() methods are given that they can print any type data type valueit may be an byte short word int long float double char etc.
====================================================================
To compile the above program
javac hello.java
To run the above program
java hello
good work
ReplyDeletethanking you sir .sir plz keep visiting my blog and . add g+ for each page u see .
ReplyDelete