SlideShare uma empresa Scribd logo
1 de 1
Baixar para ler offline
a)Write a method named returnHours with two parameters: a string representing your name
and the number of hours you spend sleeping.
Make the string by appending your name and the number of hours you spend sleeping.
Return this string.
b)In the main method:
Declare and initialize your name and hours you sleep in the main method.
Call returnHourse, passing your name and hours you sleep as arguments.
c)The value returned by the method will be stored in a variable in main.
d)Print the variable containing the returned value in main.
Start with:
public class PassingReturnMethod {
public static void main(String[] args) {

Mais conteúdo relacionado

Mais de advanibagco

Barilla un fabricante de pasta italiano lanz un programa .pdf
Barilla un fabricante de pasta italiano lanz un programa .pdfBarilla un fabricante de pasta italiano lanz un programa .pdf
Barilla un fabricante de pasta italiano lanz un programa .pdf
advanibagco
 
Balangta ekonominin uzun dnem dengede olduunu varsayalm A.pdf
Balangta ekonominin uzun dnem dengede olduunu varsayalm A.pdfBalangta ekonominin uzun dnem dengede olduunu varsayalm A.pdf
Balangta ekonominin uzun dnem dengede olduunu varsayalm A.pdf
advanibagco
 
Balangta Vakflarn dnya apndaki tm programlar iin Kdeml.pdf
Balangta Vakflarn dnya apndaki tm programlar iin Kdeml.pdfBalangta Vakflarn dnya apndaki tm programlar iin Kdeml.pdf
Balangta Vakflarn dnya apndaki tm programlar iin Kdeml.pdf
advanibagco
 
Background This case study presents a 68year old righthan.pdf
Background This case study presents a 68year old righthan.pdfBackground This case study presents a 68year old righthan.pdf
Background This case study presents a 68year old righthan.pdf
advanibagco
 
Background You are the Quality Manager at ZAPO a manufactu.pdf
Background You are the Quality Manager at ZAPO a manufactu.pdfBackground You are the Quality Manager at ZAPO a manufactu.pdf
Background You are the Quality Manager at ZAPO a manufactu.pdf
advanibagco
 

Mais de advanibagco (20)

Bart has been a successful Chief Financial Officer for the W.pdf
Bart has been a successful Chief Financial Officer for the W.pdfBart has been a successful Chief Financial Officer for the W.pdf
Bart has been a successful Chief Financial Officer for the W.pdf
 
Barilla un fabricante de pasta italiano lanz un programa .pdf
Barilla un fabricante de pasta italiano lanz un programa .pdfBarilla un fabricante de pasta italiano lanz un programa .pdf
Barilla un fabricante de pasta italiano lanz un programa .pdf
 
Banks securitize assets by combining debt instruments and st.pdf
Banks securitize assets by combining debt instruments and st.pdfBanks securitize assets by combining debt instruments and st.pdf
Banks securitize assets by combining debt instruments and st.pdf
 
Bamllklar elerken veya bir sosyal a olutururken aadakiler ge.pdf
Bamllklar elerken veya bir sosyal a olutururken aadakiler ge.pdfBamllklar elerken veya bir sosyal a olutururken aadakiler ge.pdf
Bamllklar elerken veya bir sosyal a olutururken aadakiler ge.pdf
 
Bank X and Bank Y are two of the top 5 banks operating in Za.pdf
Bank X and Bank Y are two of the top 5 banks operating in Za.pdfBank X and Bank Y are two of the top 5 banks operating in Za.pdf
Bank X and Bank Y are two of the top 5 banks operating in Za.pdf
 
Bank of Montreal v Duguid 2000 47 OR 3d 737 CA 12000.pdf
Bank of Montreal v Duguid 2000 47 OR 3d 737 CA 12000.pdfBank of Montreal v Duguid 2000 47 OR 3d 737 CA 12000.pdf
Bank of Montreal v Duguid 2000 47 OR 3d 737 CA 12000.pdf
 
Balangta ekonominin uzun dnem dengede olduunu varsayalm A.pdf
Balangta ekonominin uzun dnem dengede olduunu varsayalm A.pdfBalangta ekonominin uzun dnem dengede olduunu varsayalm A.pdf
Balangta ekonominin uzun dnem dengede olduunu varsayalm A.pdf
 
Bal arlarnda Apis mellifera yiyecek aramaya gei koloniy.pdf
Bal arlarnda  Apis mellifera  yiyecek aramaya gei koloniy.pdfBal arlarnda  Apis mellifera  yiyecek aramaya gei koloniy.pdf
Bal arlarnda Apis mellifera yiyecek aramaya gei koloniy.pdf
 
Balangta Vakflarn dnya apndaki tm programlar iin Kdeml.pdf
Balangta Vakflarn dnya apndaki tm programlar iin Kdeml.pdfBalangta Vakflarn dnya apndaki tm programlar iin Kdeml.pdf
Balangta Vakflarn dnya apndaki tm programlar iin Kdeml.pdf
 
b Mr Senabe is a senior teacher in a Senior Secondary S.pdf
b Mr Senabe is a senior teacher in a Senior Secondary S.pdfb Mr Senabe is a senior teacher in a Senior Secondary S.pdf
b Mr Senabe is a senior teacher in a Senior Secondary S.pdf
 
Bacteria sense and respond to various signals in their envir.pdf
Bacteria sense and respond to various signals in their envir.pdfBacteria sense and respond to various signals in their envir.pdf
Bacteria sense and respond to various signals in their envir.pdf
 
Background This case study presents a 68year old righthan.pdf
Background This case study presents a 68year old righthan.pdfBackground This case study presents a 68year old righthan.pdf
Background This case study presents a 68year old righthan.pdf
 
Baklk sistemi tanmann biyolojik sonular unlar ierebilir .pdf
Baklk sistemi tanmann biyolojik sonular unlar ierebilir  .pdfBaklk sistemi tanmann biyolojik sonular unlar ierebilir  .pdf
Baklk sistemi tanmann biyolojik sonular unlar ierebilir .pdf
 
Background You are the Quality Manager at ZAPO a manufactu.pdf
Background You are the Quality Manager at ZAPO a manufactu.pdfBackground You are the Quality Manager at ZAPO a manufactu.pdf
Background You are the Quality Manager at ZAPO a manufactu.pdf
 
Background Evidence of Evolution When Charles Darwin first p.pdf
Background Evidence of Evolution When Charles Darwin first p.pdfBackground Evidence of Evolution When Charles Darwin first p.pdf
Background Evidence of Evolution When Charles Darwin first p.pdf
 
Baary belirleyecek kilit oyuncularn kimler olduunu belirledi.pdf
Baary belirleyecek kilit oyuncularn kimler olduunu belirledi.pdfBaary belirleyecek kilit oyuncularn kimler olduunu belirledi.pdf
Baary belirleyecek kilit oyuncularn kimler olduunu belirledi.pdf
 
B4 110ltCOOgB2gt One iogic function that is used for a.pdf
B4 110ltCOOgB2gt One iogic function that is used for a.pdfB4 110ltCOOgB2gt One iogic function that is used for a.pdf
B4 110ltCOOgB2gt One iogic function that is used for a.pdf
 
B1 Describe the rock cycle How does this cycle relate to t.pdf
B1 Describe the rock cycle How does this cycle relate to t.pdfB1 Describe the rock cycle How does this cycle relate to t.pdf
B1 Describe the rock cycle How does this cycle relate to t.pdf
 
B4 10 One logic function that is used for a variety of p.pdf
B4 10  One logic function that is used for a variety of p.pdfB4 10  One logic function that is used for a variety of p.pdf
B4 10 One logic function that is used for a variety of p.pdf
 
B The Paris Agreement is a global plan to address climate c.pdf
B The Paris Agreement is a global plan to address climate c.pdfB The Paris Agreement is a global plan to address climate c.pdf
B The Paris Agreement is a global plan to address climate c.pdf
 

Último

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Último (20)

Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
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
 
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
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.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...
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 

aWrite a method named returnHours with two parameters a st.pdf

  • 1. a)Write a method named returnHours with two parameters: a string representing your name and the number of hours you spend sleeping. Make the string by appending your name and the number of hours you spend sleeping. Return this string. b)In the main method: Declare and initialize your name and hours you sleep in the main method. Call returnHourse, passing your name and hours you sleep as arguments. c)The value returned by the method will be stored in a variable in main. d)Print the variable containing the returned value in main. Start with: public class PassingReturnMethod { public static void main(String[] args) {