1. Write a program in java to print or display "Hello World".
class User{
public static void main(String[] args){
System.out.println("Hello World");
}
}
Save the above code into a file, let us say User.java
Compile the source file from the command prompt:
prompt>javac User.java
Now you will have two files, one is your source file User.java and another one is the compiled file namely User.class
Now execute your newly born class as follows and watch the output on next line.
prompt>java User
Hello World
Back to Exercise
class User{
public static void main(String[] args){
System.out.println("Hello World");
}
}
Save the above code into a file, let us say User.java
Compile the source file from the command prompt:
prompt>javac User.java
Now you will have two files, one is your source file User.java and another one is the compiled file namely User.class
Now execute your newly born class as follows and watch the output on next line.
prompt>java User
Hello World
Back to Exercise
I have read your blog its very attractive and impressive. I like it your blog.
ReplyDeleteJava Training in Chennai Java Training in Chennai | Core Java Training in Chennai | Java Training Institutes
Online Java Training Java Online Training | Java J2EE Online Training | JavaEE Training Institute in Chennai