SlideShare a Scribd company logo
1 of 2
Download to read offline
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");
}
}
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");

More Related Content

Similar to Java Hello program with output

Java Programs Lab File
Java Programs Lab FileJava Programs Lab File
Java Programs Lab FileKandarp Tiwari
Β 
Unit2 java
Unit2 javaUnit2 java
Unit2 javamrecedu
Β 
java 1 new.pdf
java 1 new.pdfjava 1 new.pdf
java 1 new.pdfSulSya
Β 
Write a java program that would ask the user to enter an input file .pdf
Write a java program that would ask the user to enter an input file .pdfWrite a java program that would ask the user to enter an input file .pdf
Write a java program that would ask the user to enter an input file .pdfudit652068
Β 
How to write a simple java program in 10 steps
How to write a simple java program in 10 stepsHow to write a simple java program in 10 steps
How to write a simple java program in 10 stepsIshara Amarasekera
Β 
Chapter 2.1
Chapter 2.1Chapter 2.1
Chapter 2.1sotlsoc
Β 
Introduction to Software Development
Introduction to Software DevelopmentIntroduction to Software Development
Introduction to Software DevelopmentZeeshan MIrza
Β 
Chapter 2.4
Chapter 2.4Chapter 2.4
Chapter 2.4sotlsoc
Β 
Lecture - 2 Environment setup & JDK, JRE, JVM
Lecture - 2 Environment setup & JDK, JRE, JVMLecture - 2 Environment setup & JDK, JRE, JVM
Lecture - 2 Environment setup & JDK, JRE, JVMmanish kumar
Β 
Java Practical File Diploma
Java Practical File DiplomaJava Practical File Diploma
Java Practical File Diplomamustkeem khan
Β 
Java Programming
Java ProgrammingJava Programming
Java ProgrammingAnjan Mahanta
Β 
PAGE 1Input output for a file tutorialStreams and File IOI.docx
PAGE  1Input output for a file tutorialStreams and File IOI.docxPAGE  1Input output for a file tutorialStreams and File IOI.docx
PAGE 1Input output for a file tutorialStreams and File IOI.docxalfred4lewis58146
Β 
Slide8appletv2 091028110313-phpapp01
Slide8appletv2 091028110313-phpapp01Slide8appletv2 091028110313-phpapp01
Slide8appletv2 091028110313-phpapp01Abhishek Khune
Β 
Core java introduction
Core java introduction Core java introduction
Core java introduction Som Prakash Rai
Β 
Java Notes by C. Sreedhar, GPREC
Java Notes by C. Sreedhar, GPRECJava Notes by C. Sreedhar, GPREC
Java Notes by C. Sreedhar, GPRECSreedhar Chowdam
Β 
Smart material - Unit 3 (2).pdf
Smart material - Unit 3 (2).pdfSmart material - Unit 3 (2).pdf
Smart material - Unit 3 (2).pdfGayathriRHICETCSESTA
Β 
Smart material - Unit 3 (1).pdf
Smart material - Unit 3 (1).pdfSmart material - Unit 3 (1).pdf
Smart material - Unit 3 (1).pdfGayathriRHICETCSESTA
Β 

Similar to Java Hello program with output (20)

Java Programs Lab File
Java Programs Lab FileJava Programs Lab File
Java Programs Lab File
Β 
Unit2 java
Unit2 javaUnit2 java
Unit2 java
Β 
java 1 new.pdf
java 1 new.pdfjava 1 new.pdf
java 1 new.pdf
Β 
Write a java program that would ask the user to enter an input file .pdf
Write a java program that would ask the user to enter an input file .pdfWrite a java program that would ask the user to enter an input file .pdf
Write a java program that would ask the user to enter an input file .pdf
Β 
Javalecture 1
Javalecture 1Javalecture 1
Javalecture 1
Β 
How to write a simple java program in 10 steps
How to write a simple java program in 10 stepsHow to write a simple java program in 10 steps
How to write a simple java program in 10 steps
Β 
Chapter 2.1
Chapter 2.1Chapter 2.1
Chapter 2.1
Β 
Introduction to Software Development
Introduction to Software DevelopmentIntroduction to Software Development
Introduction to Software Development
Β 
Chapter 2.4
Chapter 2.4Chapter 2.4
Chapter 2.4
Β 
Lecture - 2 Environment setup & JDK, JRE, JVM
Lecture - 2 Environment setup & JDK, JRE, JVMLecture - 2 Environment setup & JDK, JRE, JVM
Lecture - 2 Environment setup & JDK, JRE, JVM
Β 
Java Practical File Diploma
Java Practical File DiplomaJava Practical File Diploma
Java Practical File Diploma
Β 
Introduction to Java Programming
Introduction to Java ProgrammingIntroduction to Java Programming
Introduction to Java Programming
Β 
Java Programming
Java ProgrammingJava Programming
Java Programming
Β 
PAGE 1Input output for a file tutorialStreams and File IOI.docx
PAGE  1Input output for a file tutorialStreams and File IOI.docxPAGE  1Input output for a file tutorialStreams and File IOI.docx
PAGE 1Input output for a file tutorialStreams and File IOI.docx
Β 
Slide8appletv2 091028110313-phpapp01
Slide8appletv2 091028110313-phpapp01Slide8appletv2 091028110313-phpapp01
Slide8appletv2 091028110313-phpapp01
Β 
Core java introduction
Core java introduction Core java introduction
Core java introduction
Β 
Java Notes by C. Sreedhar, GPREC
Java Notes by C. Sreedhar, GPRECJava Notes by C. Sreedhar, GPREC
Java Notes by C. Sreedhar, GPREC
Β 
Java Notes
Java Notes Java Notes
Java Notes
Β 
Smart material - Unit 3 (2).pdf
Smart material - Unit 3 (2).pdfSmart material - Unit 3 (2).pdf
Smart material - Unit 3 (2).pdf
Β 
Smart material - Unit 3 (1).pdf
Smart material - Unit 3 (1).pdfSmart material - Unit 3 (1).pdf
Smart material - Unit 3 (1).pdf
Β 

Recently uploaded

Bhimtal ❀CALL GIRL 8617697112 ❀CALL GIRLS IN Bhimtal ESCORT SERVICE❀CALL GIRL
Bhimtal ❀CALL GIRL 8617697112 ❀CALL GIRLS IN Bhimtal ESCORT SERVICE❀CALL GIRLBhimtal ❀CALL GIRL 8617697112 ❀CALL GIRLS IN Bhimtal ESCORT SERVICE❀CALL GIRL
Bhimtal ❀CALL GIRL 8617697112 ❀CALL GIRLS IN Bhimtal ESCORT SERVICE❀CALL GIRLNitya salvi
Β 
Zirakpur Call GirlsπŸ‘§ Book NowπŸ“±8146719683 πŸ“žπŸ‘‰Mohali Call Girl Service No Advanc...
Zirakpur Call GirlsπŸ‘§ Book NowπŸ“±8146719683 πŸ“žπŸ‘‰Mohali Call Girl Service No Advanc...Zirakpur Call GirlsπŸ‘§ Book NowπŸ“±8146719683 πŸ“žπŸ‘‰Mohali Call Girl Service No Advanc...
Zirakpur Call GirlsπŸ‘§ Book NowπŸ“±8146719683 πŸ“žπŸ‘‰Mohali Call Girl Service No Advanc...rajveermohali2022
Β 
Book Sex Workers Available Kolkata Call Girls Service Airport Kolkata βœ” 62971...
Book Sex Workers Available Kolkata Call Girls Service Airport Kolkata βœ” 62971...Book Sex Workers Available Kolkata Call Girls Service Airport Kolkata βœ” 62971...
Book Sex Workers Available Kolkata Call Girls Service Airport Kolkata βœ” 62971...ritikasharma
Β 
Hotel And Home Service Available Kolkata Call Girls Lake Town βœ” 6297143586 βœ”C...
Hotel And Home Service Available Kolkata Call Girls Lake Town βœ” 6297143586 βœ”C...Hotel And Home Service Available Kolkata Call Girls Lake Town βœ” 6297143586 βœ”C...
Hotel And Home Service Available Kolkata Call Girls Lake Town βœ” 6297143586 βœ”C...ritikasharma
Β 
Verified Trusted Call Girls Tambaram Chennai βœ”βœ”7427069034 Independent Chenna...
Verified Trusted Call Girls Tambaram Chennai βœ”βœ”7427069034  Independent Chenna...Verified Trusted Call Girls Tambaram Chennai βœ”βœ”7427069034  Independent Chenna...
Verified Trusted Call Girls Tambaram Chennai βœ”βœ”7427069034 Independent Chenna... Shivani Pandey
Β 
Hire πŸ’• 8617697112 North Sikkim Call Girls Service Call Girls Agency
Hire πŸ’• 8617697112 North Sikkim Call Girls Service Call Girls AgencyHire πŸ’• 8617697112 North Sikkim Call Girls Service Call Girls Agency
Hire πŸ’• 8617697112 North Sikkim Call Girls Service Call Girls AgencyNitya salvi
Β 
Almora call girls πŸ“ž 8617697112 At Low Cost Cash Payment Booking
Almora call girls πŸ“ž 8617697112 At Low Cost Cash Payment BookingAlmora call girls πŸ“ž 8617697112 At Low Cost Cash Payment Booking
Almora call girls πŸ“ž 8617697112 At Low Cost Cash Payment BookingNitya salvi
Β 
❀Personal Whatsapp Number Mukteshwar Call Girls 8617697112 πŸ’¦βœ….
❀Personal Whatsapp Number Mukteshwar Call Girls 8617697112 πŸ’¦βœ….❀Personal Whatsapp Number Mukteshwar Call Girls 8617697112 πŸ’¦βœ….
❀Personal Whatsapp Number Mukteshwar Call Girls 8617697112 πŸ’¦βœ….Nitya salvi
Β 
CHEAP Call Girls in Malviya Nagar, (-DELHI )πŸ” 9953056974πŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in  Malviya Nagar, (-DELHI )πŸ” 9953056974πŸ”(=)/CALL GIRLS SERVICECHEAP Call Girls in  Malviya Nagar, (-DELHI )πŸ” 9953056974πŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Malviya Nagar, (-DELHI )πŸ” 9953056974πŸ”(=)/CALL GIRLS SERVICE9953056974 Low Rate Call Girls In Saket, Delhi NCR
Β 
Top Rated Pune Call Girls Dhayari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Dhayari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Dhayari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Dhayari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Call Girls in Nagpur High Profile
Β 
(TOP CLASS) Call Girls In Chengalpattu Phone 7427069034 Call Girls Model With...
(TOP CLASS) Call Girls In Chengalpattu Phone 7427069034 Call Girls Model With...(TOP CLASS) Call Girls In Chengalpattu Phone 7427069034 Call Girls Model With...
(TOP CLASS) Call Girls In Chengalpattu Phone 7427069034 Call Girls Model With... Shivani Pandey
Β 
Beautiful πŸ˜‹ Call girls in Lahore 03210033448
Beautiful πŸ˜‹ Call girls in Lahore 03210033448Beautiful πŸ˜‹ Call girls in Lahore 03210033448
Beautiful πŸ˜‹ Call girls in Lahore 03210033448ont65320
Β 
Hotel And Home Service Available Kolkata Call Girls Dum Dum βœ” 6297143586 βœ”Cal...
Hotel And Home Service Available Kolkata Call Girls Dum Dum βœ” 6297143586 βœ”Cal...Hotel And Home Service Available Kolkata Call Girls Dum Dum βœ” 6297143586 βœ”Cal...
Hotel And Home Service Available Kolkata Call Girls Dum Dum βœ” 6297143586 βœ”Cal...ritikasharma
Β 
Verified Trusted Call Girls Ambattur Chennai βœ”βœ”7427069034 Independent Chenna...
Verified Trusted Call Girls Ambattur Chennai βœ”βœ”7427069034  Independent Chenna...Verified Trusted Call Girls Ambattur Chennai βœ”βœ”7427069034  Independent Chenna...
Verified Trusted Call Girls Ambattur Chennai βœ”βœ”7427069034 Independent Chenna... Shivani Pandey
Β 
Call Girls Bellandur ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Bellandur ☎ 7737669865☎ Book Your One night Stand (Bangalore)Call Girls Bellandur ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Bellandur ☎ 7737669865☎ Book Your One night Stand (Bangalore)amitlee9823
Β 
Top Rated Pune Call Girls Pimpri Chinchwad ⟟ 6297143586 ⟟ Call Me For Genuin...
Top Rated  Pune Call Girls Pimpri Chinchwad ⟟ 6297143586 ⟟ Call Me For Genuin...Top Rated  Pune Call Girls Pimpri Chinchwad ⟟ 6297143586 ⟟ Call Me For Genuin...
Top Rated Pune Call Girls Pimpri Chinchwad ⟟ 6297143586 ⟟ Call Me For Genuin...Call Girls in Nagpur High Profile
Β 
πŸ“ž Contact Number 8617697112 VIP East Sikkim Call Girls
πŸ“ž Contact Number 8617697112 VIP East Sikkim Call GirlsπŸ“ž Contact Number 8617697112 VIP East Sikkim Call Girls
πŸ“ž Contact Number 8617697112 VIP East Sikkim Call GirlsNitya salvi
Β 
π“€€Call On 6297143586 π“€€ Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
π“€€Call On 6297143586 π“€€ Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...π“€€Call On 6297143586 π“€€ Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
π“€€Call On 6297143586 π“€€ Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...rahim quresi
Β 
Borum Call Girls Service ☎ ️93326-06886 ❀️‍πŸ”₯ Enjoy 24/7 EscortΒ Service
Borum Call Girls Service ☎ ️93326-06886 ❀️‍πŸ”₯ Enjoy 24/7 EscortΒ ServiceBorum Call Girls Service ☎ ️93326-06886 ❀️‍πŸ”₯ Enjoy 24/7 EscortΒ Service
Borum Call Girls Service ☎ ️93326-06886 ❀️‍πŸ”₯ Enjoy 24/7 EscortΒ ServiceDamini Dixit
Β 
❀Personal Whatsapp Number Keylong Call Girls 8617697112 πŸ’¦βœ….
❀Personal Whatsapp Number Keylong Call Girls 8617697112 πŸ’¦βœ….❀Personal Whatsapp Number Keylong Call Girls 8617697112 πŸ’¦βœ….
❀Personal Whatsapp Number Keylong Call Girls 8617697112 πŸ’¦βœ….Nitya salvi
Β 

Recently uploaded (20)

Bhimtal ❀CALL GIRL 8617697112 ❀CALL GIRLS IN Bhimtal ESCORT SERVICE❀CALL GIRL
Bhimtal ❀CALL GIRL 8617697112 ❀CALL GIRLS IN Bhimtal ESCORT SERVICE❀CALL GIRLBhimtal ❀CALL GIRL 8617697112 ❀CALL GIRLS IN Bhimtal ESCORT SERVICE❀CALL GIRL
Bhimtal ❀CALL GIRL 8617697112 ❀CALL GIRLS IN Bhimtal ESCORT SERVICE❀CALL GIRL
Β 
Zirakpur Call GirlsπŸ‘§ Book NowπŸ“±8146719683 πŸ“žπŸ‘‰Mohali Call Girl Service No Advanc...
Zirakpur Call GirlsπŸ‘§ Book NowπŸ“±8146719683 πŸ“žπŸ‘‰Mohali Call Girl Service No Advanc...Zirakpur Call GirlsπŸ‘§ Book NowπŸ“±8146719683 πŸ“žπŸ‘‰Mohali Call Girl Service No Advanc...
Zirakpur Call GirlsπŸ‘§ Book NowπŸ“±8146719683 πŸ“žπŸ‘‰Mohali Call Girl Service No Advanc...
Β 
Book Sex Workers Available Kolkata Call Girls Service Airport Kolkata βœ” 62971...
Book Sex Workers Available Kolkata Call Girls Service Airport Kolkata βœ” 62971...Book Sex Workers Available Kolkata Call Girls Service Airport Kolkata βœ” 62971...
Book Sex Workers Available Kolkata Call Girls Service Airport Kolkata βœ” 62971...
Β 
Hotel And Home Service Available Kolkata Call Girls Lake Town βœ” 6297143586 βœ”C...
Hotel And Home Service Available Kolkata Call Girls Lake Town βœ” 6297143586 βœ”C...Hotel And Home Service Available Kolkata Call Girls Lake Town βœ” 6297143586 βœ”C...
Hotel And Home Service Available Kolkata Call Girls Lake Town βœ” 6297143586 βœ”C...
Β 
Verified Trusted Call Girls Tambaram Chennai βœ”βœ”7427069034 Independent Chenna...
Verified Trusted Call Girls Tambaram Chennai βœ”βœ”7427069034  Independent Chenna...Verified Trusted Call Girls Tambaram Chennai βœ”βœ”7427069034  Independent Chenna...
Verified Trusted Call Girls Tambaram Chennai βœ”βœ”7427069034 Independent Chenna...
Β 
Hire πŸ’• 8617697112 North Sikkim Call Girls Service Call Girls Agency
Hire πŸ’• 8617697112 North Sikkim Call Girls Service Call Girls AgencyHire πŸ’• 8617697112 North Sikkim Call Girls Service Call Girls Agency
Hire πŸ’• 8617697112 North Sikkim Call Girls Service Call Girls Agency
Β 
Almora call girls πŸ“ž 8617697112 At Low Cost Cash Payment Booking
Almora call girls πŸ“ž 8617697112 At Low Cost Cash Payment BookingAlmora call girls πŸ“ž 8617697112 At Low Cost Cash Payment Booking
Almora call girls πŸ“ž 8617697112 At Low Cost Cash Payment Booking
Β 
❀Personal Whatsapp Number Mukteshwar Call Girls 8617697112 πŸ’¦βœ….
❀Personal Whatsapp Number Mukteshwar Call Girls 8617697112 πŸ’¦βœ….❀Personal Whatsapp Number Mukteshwar Call Girls 8617697112 πŸ’¦βœ….
❀Personal Whatsapp Number Mukteshwar Call Girls 8617697112 πŸ’¦βœ….
Β 
CHEAP Call Girls in Malviya Nagar, (-DELHI )πŸ” 9953056974πŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in  Malviya Nagar, (-DELHI )πŸ” 9953056974πŸ”(=)/CALL GIRLS SERVICECHEAP Call Girls in  Malviya Nagar, (-DELHI )πŸ” 9953056974πŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Malviya Nagar, (-DELHI )πŸ” 9953056974πŸ”(=)/CALL GIRLS SERVICE
Β 
Top Rated Pune Call Girls Dhayari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Dhayari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Dhayari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Dhayari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Β 
(TOP CLASS) Call Girls In Chengalpattu Phone 7427069034 Call Girls Model With...
(TOP CLASS) Call Girls In Chengalpattu Phone 7427069034 Call Girls Model With...(TOP CLASS) Call Girls In Chengalpattu Phone 7427069034 Call Girls Model With...
(TOP CLASS) Call Girls In Chengalpattu Phone 7427069034 Call Girls Model With...
Β 
Beautiful πŸ˜‹ Call girls in Lahore 03210033448
Beautiful πŸ˜‹ Call girls in Lahore 03210033448Beautiful πŸ˜‹ Call girls in Lahore 03210033448
Beautiful πŸ˜‹ Call girls in Lahore 03210033448
Β 
Hotel And Home Service Available Kolkata Call Girls Dum Dum βœ” 6297143586 βœ”Cal...
Hotel And Home Service Available Kolkata Call Girls Dum Dum βœ” 6297143586 βœ”Cal...Hotel And Home Service Available Kolkata Call Girls Dum Dum βœ” 6297143586 βœ”Cal...
Hotel And Home Service Available Kolkata Call Girls Dum Dum βœ” 6297143586 βœ”Cal...
Β 
Verified Trusted Call Girls Ambattur Chennai βœ”βœ”7427069034 Independent Chenna...
Verified Trusted Call Girls Ambattur Chennai βœ”βœ”7427069034  Independent Chenna...Verified Trusted Call Girls Ambattur Chennai βœ”βœ”7427069034  Independent Chenna...
Verified Trusted Call Girls Ambattur Chennai βœ”βœ”7427069034 Independent Chenna...
Β 
Call Girls Bellandur ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Bellandur ☎ 7737669865☎ Book Your One night Stand (Bangalore)Call Girls Bellandur ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Bellandur ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Β 
Top Rated Pune Call Girls Pimpri Chinchwad ⟟ 6297143586 ⟟ Call Me For Genuin...
Top Rated  Pune Call Girls Pimpri Chinchwad ⟟ 6297143586 ⟟ Call Me For Genuin...Top Rated  Pune Call Girls Pimpri Chinchwad ⟟ 6297143586 ⟟ Call Me For Genuin...
Top Rated Pune Call Girls Pimpri Chinchwad ⟟ 6297143586 ⟟ Call Me For Genuin...
Β 
πŸ“ž Contact Number 8617697112 VIP East Sikkim Call Girls
πŸ“ž Contact Number 8617697112 VIP East Sikkim Call GirlsπŸ“ž Contact Number 8617697112 VIP East Sikkim Call Girls
πŸ“ž Contact Number 8617697112 VIP East Sikkim Call Girls
Β 
π“€€Call On 6297143586 π“€€ Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
π“€€Call On 6297143586 π“€€ Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...π“€€Call On 6297143586 π“€€ Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
π“€€Call On 6297143586 π“€€ Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
Β 
Borum Call Girls Service ☎ ️93326-06886 ❀️‍πŸ”₯ Enjoy 24/7 EscortΒ Service
Borum Call Girls Service ☎ ️93326-06886 ❀️‍πŸ”₯ Enjoy 24/7 EscortΒ ServiceBorum Call Girls Service ☎ ️93326-06886 ❀️‍πŸ”₯ Enjoy 24/7 EscortΒ Service
Borum Call Girls Service ☎ ️93326-06886 ❀️‍πŸ”₯ Enjoy 24/7 EscortΒ Service
Β 
❀Personal Whatsapp Number Keylong Call Girls 8617697112 πŸ’¦βœ….
❀Personal Whatsapp Number Keylong Call Girls 8617697112 πŸ’¦βœ….❀Personal Whatsapp Number Keylong Call Girls 8617697112 πŸ’¦βœ….
❀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");