SlideShare a Scribd company logo
So lets Start, in Java Programming, to take input from the user and print Hello of the user,we use
the following code.
Code:-
import java.util.Scanner;
class GetInputFromUser
{
public static void main(String args[])
{
String s;
Scanner in = new Scanner(System.in);
System.out.println("Enter Your name:");
s = in.nextLine();
System.out.println("Hello "+s);
}
}
Solution
So lets Start, in Java Programming, to take input from the user and print Hello of the user,we use
the following code.
Code:-
import java.util.Scanner;
class GetInputFromUser
{
public static void main(String args[])
{
String s;
Scanner in = new Scanner(System.in);
System.out.println("Enter Your name:");
s = in.nextLine();
System.out.println("Hello "+s);
}
}

More Related Content

More from aniltulyani

Compound 4 is the correct answer. This is becaus.pdf
                     Compound 4 is the correct answer.  This is becaus.pdf                     Compound 4 is the correct answer.  This is becaus.pdf
Compound 4 is the correct answer. This is becaus.pdf
aniltulyani
 
n+ 93Solutionn+ 93.pdf
n+ 93Solutionn+ 93.pdfn+ 93Solutionn+ 93.pdf
n+ 93Solutionn+ 93.pdf
aniltulyani
 
LHCII is the light-harvesting complex II which involves in the initi.pdf
LHCII is the light-harvesting complex II which involves in the initi.pdfLHCII is the light-harvesting complex II which involves in the initi.pdf
LHCII is the light-harvesting complex II which involves in the initi.pdf
aniltulyani
 
Bromide is the better nucleophile in aqueous solu.pdf
                     Bromide is the better nucleophile in aqueous solu.pdf                     Bromide is the better nucleophile in aqueous solu.pdf
Bromide is the better nucleophile in aqueous solu.pdf
aniltulyani
 
x = 4Solutionx = 4.pdf
x = 4Solutionx = 4.pdfx = 4Solutionx = 4.pdf
x = 4Solutionx = 4.pdf
aniltulyani
 
The jokes are great.It is a statement.SolutionThe jokes are .pdf
The jokes are great.It is a statement.SolutionThe jokes are .pdfThe jokes are great.It is a statement.SolutionThe jokes are .pdf
The jokes are great.It is a statement.SolutionThe jokes are .pdf
aniltulyani
 
Solution#includeiostream.h #includefstream.h #includecon.pdf
Solution#includeiostream.h #includefstream.h #includecon.pdfSolution#includeiostream.h #includefstream.h #includecon.pdf
Solution#includeiostream.h #includefstream.h #includecon.pdf
aniltulyani
 
Supercritical uid extraction (SFE) has been developed as a technique.pdf
Supercritical uid extraction (SFE) has been developed as a technique.pdfSupercritical uid extraction (SFE) has been developed as a technique.pdf
Supercritical uid extraction (SFE) has been developed as a technique.pdf
aniltulyani
 
melting point increasesVapor pressure decreasesboiling point.pdf
melting point increasesVapor pressure decreasesboiling point.pdfmelting point increasesVapor pressure decreasesboiling point.pdf
melting point increasesVapor pressure decreasesboiling point.pdf
aniltulyani
 
nature of networks affect the deployment of IPv6The thing to cons.pdf
nature of networks affect the deployment of IPv6The thing to cons.pdfnature of networks affect the deployment of IPv6The thing to cons.pdf
nature of networks affect the deployment of IPv6The thing to cons.pdf
aniltulyani
 
let me know if you find the answer!!Solutionlet me know if you.pdf
let me know if you find the answer!!Solutionlet me know if you.pdflet me know if you find the answer!!Solutionlet me know if you.pdf
let me know if you find the answer!!Solutionlet me know if you.pdf
aniltulyani
 
G and G have same of vertices with even degree and odd degreeS.pdf
G and G have same of vertices with even degree and odd degreeS.pdfG and G have same of vertices with even degree and odd degreeS.pdf
G and G have same of vertices with even degree and odd degreeS.pdf
aniltulyani
 
Cost NOT charged to the product under absorption costing isFixed a.pdf
Cost NOT charged to the product under absorption costing isFixed a.pdfCost NOT charged to the product under absorption costing isFixed a.pdf
Cost NOT charged to the product under absorption costing isFixed a.pdf
aniltulyani
 
d is trueSolutiond is true.pdf
d is trueSolutiond is true.pdfd is trueSolutiond is true.pdf
d is trueSolutiond is true.pdf
aniltulyani
 
A anion is a ionic species with a negative charge.pdf
                     A anion is a ionic species with a negative charge.pdf                     A anion is a ionic species with a negative charge.pdf
A anion is a ionic species with a negative charge.pdf
aniltulyani
 
Bactreria like Pseudomonas communicate with each other through a sig.pdf
Bactreria like Pseudomonas communicate with each other through a sig.pdfBactreria like Pseudomonas communicate with each other through a sig.pdf
Bactreria like Pseudomonas communicate with each other through a sig.pdf
aniltulyani
 
B. A single interface may be assigned multiple IPv6 addresses of any.pdf
B. A single interface may be assigned multiple IPv6 addresses of any.pdfB. A single interface may be assigned multiple IPv6 addresses of any.pdf
B. A single interface may be assigned multiple IPv6 addresses of any.pdf
aniltulyani
 
Answer is A) AuthenticationAuthentication is used to ensure that a.pdf
Answer is A) AuthenticationAuthentication is used to ensure that a.pdfAnswer is A) AuthenticationAuthentication is used to ensure that a.pdf
Answer is A) AuthenticationAuthentication is used to ensure that a.pdf
aniltulyani
 
Answer b) T cellsThe different manifestations of infection with M.pdf
Answer b) T cellsThe different manifestations of infection with M.pdfAnswer b) T cellsThe different manifestations of infection with M.pdf
Answer b) T cellsThe different manifestations of infection with M.pdf
aniltulyani
 
1.Inoculating holding medium kept at refrigeration temperature at ab.pdf
1.Inoculating holding medium kept at refrigeration temperature at ab.pdf1.Inoculating holding medium kept at refrigeration temperature at ab.pdf
1.Inoculating holding medium kept at refrigeration temperature at ab.pdf
aniltulyani
 

More from aniltulyani (20)

Compound 4 is the correct answer. This is becaus.pdf
                     Compound 4 is the correct answer.  This is becaus.pdf                     Compound 4 is the correct answer.  This is becaus.pdf
Compound 4 is the correct answer. This is becaus.pdf
 
n+ 93Solutionn+ 93.pdf
n+ 93Solutionn+ 93.pdfn+ 93Solutionn+ 93.pdf
n+ 93Solutionn+ 93.pdf
 
LHCII is the light-harvesting complex II which involves in the initi.pdf
LHCII is the light-harvesting complex II which involves in the initi.pdfLHCII is the light-harvesting complex II which involves in the initi.pdf
LHCII is the light-harvesting complex II which involves in the initi.pdf
 
Bromide is the better nucleophile in aqueous solu.pdf
                     Bromide is the better nucleophile in aqueous solu.pdf                     Bromide is the better nucleophile in aqueous solu.pdf
Bromide is the better nucleophile in aqueous solu.pdf
 
x = 4Solutionx = 4.pdf
x = 4Solutionx = 4.pdfx = 4Solutionx = 4.pdf
x = 4Solutionx = 4.pdf
 
The jokes are great.It is a statement.SolutionThe jokes are .pdf
The jokes are great.It is a statement.SolutionThe jokes are .pdfThe jokes are great.It is a statement.SolutionThe jokes are .pdf
The jokes are great.It is a statement.SolutionThe jokes are .pdf
 
Solution#includeiostream.h #includefstream.h #includecon.pdf
Solution#includeiostream.h #includefstream.h #includecon.pdfSolution#includeiostream.h #includefstream.h #includecon.pdf
Solution#includeiostream.h #includefstream.h #includecon.pdf
 
Supercritical uid extraction (SFE) has been developed as a technique.pdf
Supercritical uid extraction (SFE) has been developed as a technique.pdfSupercritical uid extraction (SFE) has been developed as a technique.pdf
Supercritical uid extraction (SFE) has been developed as a technique.pdf
 
melting point increasesVapor pressure decreasesboiling point.pdf
melting point increasesVapor pressure decreasesboiling point.pdfmelting point increasesVapor pressure decreasesboiling point.pdf
melting point increasesVapor pressure decreasesboiling point.pdf
 
nature of networks affect the deployment of IPv6The thing to cons.pdf
nature of networks affect the deployment of IPv6The thing to cons.pdfnature of networks affect the deployment of IPv6The thing to cons.pdf
nature of networks affect the deployment of IPv6The thing to cons.pdf
 
let me know if you find the answer!!Solutionlet me know if you.pdf
let me know if you find the answer!!Solutionlet me know if you.pdflet me know if you find the answer!!Solutionlet me know if you.pdf
let me know if you find the answer!!Solutionlet me know if you.pdf
 
G and G have same of vertices with even degree and odd degreeS.pdf
G and G have same of vertices with even degree and odd degreeS.pdfG and G have same of vertices with even degree and odd degreeS.pdf
G and G have same of vertices with even degree and odd degreeS.pdf
 
Cost NOT charged to the product under absorption costing isFixed a.pdf
Cost NOT charged to the product under absorption costing isFixed a.pdfCost NOT charged to the product under absorption costing isFixed a.pdf
Cost NOT charged to the product under absorption costing isFixed a.pdf
 
d is trueSolutiond is true.pdf
d is trueSolutiond is true.pdfd is trueSolutiond is true.pdf
d is trueSolutiond is true.pdf
 
A anion is a ionic species with a negative charge.pdf
                     A anion is a ionic species with a negative charge.pdf                     A anion is a ionic species with a negative charge.pdf
A anion is a ionic species with a negative charge.pdf
 
Bactreria like Pseudomonas communicate with each other through a sig.pdf
Bactreria like Pseudomonas communicate with each other through a sig.pdfBactreria like Pseudomonas communicate with each other through a sig.pdf
Bactreria like Pseudomonas communicate with each other through a sig.pdf
 
B. A single interface may be assigned multiple IPv6 addresses of any.pdf
B. A single interface may be assigned multiple IPv6 addresses of any.pdfB. A single interface may be assigned multiple IPv6 addresses of any.pdf
B. A single interface may be assigned multiple IPv6 addresses of any.pdf
 
Answer is A) AuthenticationAuthentication is used to ensure that a.pdf
Answer is A) AuthenticationAuthentication is used to ensure that a.pdfAnswer is A) AuthenticationAuthentication is used to ensure that a.pdf
Answer is A) AuthenticationAuthentication is used to ensure that a.pdf
 
Answer b) T cellsThe different manifestations of infection with M.pdf
Answer b) T cellsThe different manifestations of infection with M.pdfAnswer b) T cellsThe different manifestations of infection with M.pdf
Answer b) T cellsThe different manifestations of infection with M.pdf
 
1.Inoculating holding medium kept at refrigeration temperature at ab.pdf
1.Inoculating holding medium kept at refrigeration temperature at ab.pdf1.Inoculating holding medium kept at refrigeration temperature at ab.pdf
1.Inoculating holding medium kept at refrigeration temperature at ab.pdf
 

Recently uploaded

Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
Kartik Tiwari
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 

Recently uploaded (20)

Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 

So lets Start, in Java Programming, to take input from the user and .pdf

  • 1. So lets Start, in Java Programming, to take input from the user and print Hello of the user,we use the following code. Code:- import java.util.Scanner; class GetInputFromUser { public static void main(String args[]) { String s; Scanner in = new Scanner(System.in); System.out.println("Enter Your name:"); s = in.nextLine(); System.out.println("Hello "+s); } } Solution So lets Start, in Java Programming, to take input from the user and print Hello of the user,we use the following code. Code:- import java.util.Scanner; class GetInputFromUser { public static void main(String args[]) { String s; Scanner in = new Scanner(System.in); System.out.println("Enter Your name:");