SlideShare a Scribd company logo
1 of 2
Download to read offline
HelloName.java
import java.util.Scanner;
public class HelloName {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
System.out.println("Enter the name: ");
String name = scan.nextLine();
System.out.println("Output is:");
System.out.println("Hello "+name);
}
}
Output:
Enter the name:
class
Output is:
Hello class
Solution
HelloName.java
import java.util.Scanner;
public class HelloName {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
System.out.println("Enter the name: ");
String name = scan.nextLine();
System.out.println("Output is:");
System.out.println("Hello "+name);
}
}
Output:
Enter the name:
class
Output is:
Hello class

More Related Content

More from nandanbh86

21. True. Choline is essential in the transportation and metabolism .pdf
21. True. Choline is essential in the transportation and metabolism .pdf21. True. Choline is essential in the transportation and metabolism .pdf
21. True. Choline is essential in the transportation and metabolism .pdf
nandanbh86
 
Well, DNA is the genetic material that determines.pdf
                     Well, DNA is the genetic material that determines.pdf                     Well, DNA is the genetic material that determines.pdf
Well, DNA is the genetic material that determines.pdf
nandanbh86
 
The Auditor shall evaluate whether the information gathered from ris.pdf
The Auditor shall evaluate whether the information gathered from ris.pdfThe Auditor shall evaluate whether the information gathered from ris.pdf
The Auditor shall evaluate whether the information gathered from ris.pdf
nandanbh86
 
Test Maturity Model is generally based on Capability Maturity Model .pdf
Test Maturity Model is generally based on Capability Maturity Model .pdfTest Maturity Model is generally based on Capability Maturity Model .pdf
Test Maturity Model is generally based on Capability Maturity Model .pdf
nandanbh86
 
Statement of cash flows using the indirect methodParticularsAmo.pdf
Statement of cash flows using the indirect methodParticularsAmo.pdfStatement of cash flows using the indirect methodParticularsAmo.pdf
Statement of cash flows using the indirect methodParticularsAmo.pdf
nandanbh86
 
No it is not possible for a line to intersect just let one point.I.pdf
No it is not possible for a line to intersect just let one point.I.pdfNo it is not possible for a line to intersect just let one point.I.pdf
No it is not possible for a line to intersect just let one point.I.pdf
nandanbh86
 
Multiple sclerosis also called disseminated sclerosis, a progressive.pdf
Multiple sclerosis also called disseminated sclerosis, a progressive.pdfMultiple sclerosis also called disseminated sclerosis, a progressive.pdf
Multiple sclerosis also called disseminated sclerosis, a progressive.pdf
nandanbh86
 

More from nandanbh86 (20)

Choice B is correct. pyrophosphate groups in iso.pdf
                     Choice B is correct.  pyrophosphate groups in iso.pdf                     Choice B is correct.  pyrophosphate groups in iso.pdf
Choice B is correct. pyrophosphate groups in iso.pdf
 
21. True. Choline is essential in the transportation and metabolism .pdf
21. True. Choline is essential in the transportation and metabolism .pdf21. True. Choline is essential in the transportation and metabolism .pdf
21. True. Choline is essential in the transportation and metabolism .pdf
 
when two elements share electrons, we call they f.pdf
                     when two elements share electrons, we call they f.pdf                     when two elements share electrons, we call they f.pdf
when two elements share electrons, we call they f.pdf
 
HELLO!! Fluorine, oxygen, nitrogen and carbon on.pdf
                     HELLO!!  Fluorine, oxygen, nitrogen and carbon on.pdf                     HELLO!!  Fluorine, oxygen, nitrogen and carbon on.pdf
HELLO!! Fluorine, oxygen, nitrogen and carbon on.pdf
 
Well, DNA is the genetic material that determines.pdf
                     Well, DNA is the genetic material that determines.pdf                     Well, DNA is the genetic material that determines.pdf
Well, DNA is the genetic material that determines.pdf
 
[(dw)(ds)=5se^(7w)(4w)] ,let us write this differential equation.pdf
[(dw)(ds)=5se^(7w)(4w)] ,let us write this differential equation.pdf[(dw)(ds)=5se^(7w)(4w)] ,let us write this differential equation.pdf
[(dw)(ds)=5se^(7w)(4w)] ,let us write this differential equation.pdf
 
What is the meaning and purpose of the interaction equationSolu.pdf
What is the meaning and purpose of the interaction equationSolu.pdfWhat is the meaning and purpose of the interaction equationSolu.pdf
What is the meaning and purpose of the interaction equationSolu.pdf
 
The correct gene order is leu+ trp+ met+ . This is because in all .pdf
The correct gene order is  leu+ trp+ met+ . This is because in all .pdfThe correct gene order is  leu+ trp+ met+ . This is because in all .pdf
The correct gene order is leu+ trp+ met+ . This is because in all .pdf
 
The mechanisms involve studying the interaction between the cytoki.pdf
The mechanisms involve studying the interaction between the cytoki.pdfThe mechanisms involve studying the interaction between the cytoki.pdf
The mechanisms involve studying the interaction between the cytoki.pdf
 
The passage of molecules from the surface of a liquid into the gaseo.pdf
The passage of molecules from the surface of a liquid into the gaseo.pdfThe passage of molecules from the surface of a liquid into the gaseo.pdf
The passage of molecules from the surface of a liquid into the gaseo.pdf
 
They took the control of the sonic hedgehog expression of axolotl. T.pdf
They took the control of the sonic hedgehog expression of axolotl. T.pdfThey took the control of the sonic hedgehog expression of axolotl. T.pdf
They took the control of the sonic hedgehog expression of axolotl. T.pdf
 
The Auditor shall evaluate whether the information gathered from ris.pdf
The Auditor shall evaluate whether the information gathered from ris.pdfThe Auditor shall evaluate whether the information gathered from ris.pdf
The Auditor shall evaluate whether the information gathered from ris.pdf
 
Test Maturity Model is generally based on Capability Maturity Model .pdf
Test Maturity Model is generally based on Capability Maturity Model .pdfTest Maturity Model is generally based on Capability Maturity Model .pdf
Test Maturity Model is generally based on Capability Maturity Model .pdf
 
SolutionIn a computerized system, special journals are not used. I.pdf
SolutionIn a computerized system, special journals are not used. I.pdfSolutionIn a computerized system, special journals are not used. I.pdf
SolutionIn a computerized system, special journals are not used. I.pdf
 
Statement of cash flows using the indirect methodParticularsAmo.pdf
Statement of cash flows using the indirect methodParticularsAmo.pdfStatement of cash flows using the indirect methodParticularsAmo.pdf
Statement of cash flows using the indirect methodParticularsAmo.pdf
 
Rate of water transport in absence of aquaporins= 5 x 107 molecules.pdf
Rate of water transport in absence of aquaporins= 5 x 107 molecules.pdfRate of water transport in absence of aquaporins= 5 x 107 molecules.pdf
Rate of water transport in absence of aquaporins= 5 x 107 molecules.pdf
 
No it is not possible for a line to intersect just let one point.I.pdf
No it is not possible for a line to intersect just let one point.I.pdfNo it is not possible for a line to intersect just let one point.I.pdf
No it is not possible for a line to intersect just let one point.I.pdf
 
Let w = supremum(S). Since w = supremum(S), there is a number epsilo.pdf
Let w = supremum(S). Since w = supremum(S), there is a number epsilo.pdfLet w = supremum(S). Since w = supremum(S), there is a number epsilo.pdf
Let w = supremum(S). Since w = supremum(S), there is a number epsilo.pdf
 
Multiple sclerosis also called disseminated sclerosis, a progressive.pdf
Multiple sclerosis also called disseminated sclerosis, a progressive.pdfMultiple sclerosis also called disseminated sclerosis, a progressive.pdf
Multiple sclerosis also called disseminated sclerosis, a progressive.pdf
 
In females they have two X chromosomes, one allele may not be expres.pdf
In females they have two X chromosomes, one allele may not be expres.pdfIn females they have two X chromosomes, one allele may not be expres.pdf
In females they have two X chromosomes, one allele may not be expres.pdf
 

Recently uploaded

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Recently uploaded (20)

COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 

HelloName.javaimport java.util.Scanner; public class HelloName.pdf

  • 1. HelloName.java import java.util.Scanner; public class HelloName { public static void main(String[] args) { // TODO Auto-generated method stub Scanner scan = new Scanner(System.in); System.out.println("Enter the name: "); String name = scan.nextLine(); System.out.println("Output is:"); System.out.println("Hello "+name); } } Output: Enter the name: class Output is: Hello class Solution HelloName.java import java.util.Scanner; public class HelloName { public static void main(String[] args) { // TODO Auto-generated method stub Scanner scan = new Scanner(System.in); System.out.println("Enter the name: "); String name = scan.nextLine(); System.out.println("Output is:"); System.out.println("Hello "+name); } } Output: