β€Personal Whatsapp Number Keylong Call Girls 8617697112 π¦β .
Β
Java Hello program with output
1. Hello program in java with two methods:-
1. Through simple method.
2. Through user input method.
Through simple method
Program source code:-
Output of the above program:-
Firstly we compile the program like this javac hello1.java
Then we run the program like this java hello1
Finally we get the out of the program βHello Friendsβ
public class hello1
{
public static void main(String args[])
{
System.out.println("Hello Friends");
}
}
2. Through user input method.
Program source code:-
Output of the above program:-
οΆ If the javac compiler discovers errors in the code it will halt and display a helpful report
indicating the nature of the error.
οΆ If the javac compiler does not find any errors it will create a new file with the program name and
the .class file extension.
import java.util.Scanner;
public class Hello
{
public static void main(String arg[])
{
String Username;
Scanner sc =new Scanner(System.in);
System.out.println("Please Enter Your Good Name");
Username=sc.next();
System.out.println("Hello"+"t" +Username+"t"+"Welcome to the world of Java");