SlideShare a Scribd company logo
1 of 8
Daffodil International University
 Submitted By
Niloy Biswas (171-35-225)
 Submitted to
 S A M Matiur Rahman
Associate Head
Department of SWE
Daffodil International University
Methods
 A program that provides some functionality can be long and
contains many statements
 A method takes input, performs actions, and produces output
 In Java, each method is defined within specific class
General from of Method
Int square ( int num1, int num2){
//body of method
}
Type name parameter
General from of Method
• The parameter list is a sequence of type and identifier pairs separated by
commas.
• Parameters are essentially variables that receives the value of the arguments
passed to the method when it is called.
• If the method has no parameters, then the parameter list will be
empty.
• Methods that have a return type other than void return a value to the calling
routine using the following form of return statement.
Method declaration
public static void main (String[ ] args){
System.out.println(“This is method body”);
}
ParameterModifier Modifier ReturnType Nameof Method
Methodbody
Adding a Method to class
class Box{
float width;
float height;
float depth;
float volume() {
return width * height * depth;
}
}
Daffodil International University Student Explains Java Methods

More Related Content

What's hot

Std 12 computer chapter 8 classes and object in java (part 2)
Std 12 computer chapter 8 classes and object in java (part 2)Std 12 computer chapter 8 classes and object in java (part 2)
Std 12 computer chapter 8 classes and object in java (part 2)Nuzhat Memon
 
Java Foundations: Methods
Java Foundations: MethodsJava Foundations: Methods
Java Foundations: MethodsSvetlin Nakov
 
CIS 1403 lab 3 functions and methods in Java
CIS 1403 lab 3 functions and methods in JavaCIS 1403 lab 3 functions and methods in Java
CIS 1403 lab 3 functions and methods in JavaHamad Odhabi
 
Inheritance and Polymorphism in java simple and clear
Inheritance and Polymorphism in java simple and clear Inheritance and Polymorphism in java simple and clear
Inheritance and Polymorphism in java simple and clear ASHNA nadhm
 
Introduction to objects and inputoutput
Introduction to objects and inputoutput Introduction to objects and inputoutput
Introduction to objects and inputoutput Ahmad Idrees
 
Object oriented programming using c++
Object oriented programming using c++Object oriented programming using c++
Object oriented programming using c++Hoang Nguyen
 
Data members and member functions
Data members and member functionsData members and member functions
Data members and member functionsMarlom46
 
Class template
Class templateClass template
Class templateKousalya M
 
encapsulation, inheritance, overriding, overloading
encapsulation, inheritance, overriding, overloadingencapsulation, inheritance, overriding, overloading
encapsulation, inheritance, overriding, overloadingShivam Singhal
 
4. java intro class
4. java intro class4. java intro class
4. java intro classQuan Ho
 
Objects and classes in Visual Basic
Objects and classes in Visual BasicObjects and classes in Visual Basic
Objects and classes in Visual BasicSangeetha Sg
 
C++ Object oriented concepts & programming
C++ Object oriented concepts & programmingC++ Object oriented concepts & programming
C++ Object oriented concepts & programmingnirajmandaliya
 
Java Foundations: Basic Syntax, Conditions, Loops
Java Foundations: Basic Syntax, Conditions, LoopsJava Foundations: Basic Syntax, Conditions, Loops
Java Foundations: Basic Syntax, Conditions, LoopsSvetlin Nakov
 
البرمجة الهدفية بلغة جافا - تعدد الأشكال
البرمجة الهدفية بلغة جافا - تعدد الأشكالالبرمجة الهدفية بلغة جافا - تعدد الأشكال
البرمجة الهدفية بلغة جافا - تعدد الأشكالMahmoud Alfarra
 
C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01Zafor Iqbal
 
Variable and constants in Vb.NET
Variable and constants in Vb.NETVariable and constants in Vb.NET
Variable and constants in Vb.NETJaya Kumari
 

What's hot (20)

Std 12 computer chapter 8 classes and object in java (part 2)
Std 12 computer chapter 8 classes and object in java (part 2)Std 12 computer chapter 8 classes and object in java (part 2)
Std 12 computer chapter 8 classes and object in java (part 2)
 
Java Foundations: Methods
Java Foundations: MethodsJava Foundations: Methods
Java Foundations: Methods
 
CIS 1403 lab 3 functions and methods in Java
CIS 1403 lab 3 functions and methods in JavaCIS 1403 lab 3 functions and methods in Java
CIS 1403 lab 3 functions and methods in Java
 
Java ppt
Java pptJava ppt
Java ppt
 
Inheritance and Polymorphism in java simple and clear
Inheritance and Polymorphism in java simple and clear Inheritance and Polymorphism in java simple and clear
Inheritance and Polymorphism in java simple and clear
 
Hemajava
HemajavaHemajava
Hemajava
 
Abstract classes
Abstract classesAbstract classes
Abstract classes
 
Introduction to objects and inputoutput
Introduction to objects and inputoutput Introduction to objects and inputoutput
Introduction to objects and inputoutput
 
Object oriented programming using c++
Object oriented programming using c++Object oriented programming using c++
Object oriented programming using c++
 
Data members and member functions
Data members and member functionsData members and member functions
Data members and member functions
 
Class template
Class templateClass template
Class template
 
encapsulation, inheritance, overriding, overloading
encapsulation, inheritance, overriding, overloadingencapsulation, inheritance, overriding, overloading
encapsulation, inheritance, overriding, overloading
 
4. java intro class
4. java intro class4. java intro class
4. java intro class
 
Objects and classes in Visual Basic
Objects and classes in Visual BasicObjects and classes in Visual Basic
Objects and classes in Visual Basic
 
C++ Object oriented concepts & programming
C++ Object oriented concepts & programmingC++ Object oriented concepts & programming
C++ Object oriented concepts & programming
 
Intake 37 2
Intake 37 2Intake 37 2
Intake 37 2
 
Java Foundations: Basic Syntax, Conditions, Loops
Java Foundations: Basic Syntax, Conditions, LoopsJava Foundations: Basic Syntax, Conditions, Loops
Java Foundations: Basic Syntax, Conditions, Loops
 
البرمجة الهدفية بلغة جافا - تعدد الأشكال
البرمجة الهدفية بلغة جافا - تعدد الأشكالالبرمجة الهدفية بلغة جافا - تعدد الأشكال
البرمجة الهدفية بلغة جافا - تعدد الأشكال
 
C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01
 
Variable and constants in Vb.NET
Variable and constants in Vb.NETVariable and constants in Vb.NET
Variable and constants in Vb.NET
 

Similar to Daffodil International University Student Explains Java Methods

java Method Overloading
java Method Overloadingjava Method Overloading
java Method Overloadingomkar bhagat
 
Module 4 : methods & parameters
Module 4 : methods & parametersModule 4 : methods & parameters
Module 4 : methods & parametersPrem Kumar Badri
 
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...vekariyakashyap
 
SOEN6441.generics.ppt
SOEN6441.generics.pptSOEN6441.generics.ppt
SOEN6441.generics.pptElieMambou1
 
Explain Delegates step by step.
Explain Delegates step by step.Explain Delegates step by step.
Explain Delegates step by step.Questpond
 
PSYC 3663 SAFMEDS TERMS – Assignment 1Provide a definition for e.docx
PSYC 3663 SAFMEDS TERMS – Assignment 1Provide a definition for e.docxPSYC 3663 SAFMEDS TERMS – Assignment 1Provide a definition for e.docx
PSYC 3663 SAFMEDS TERMS – Assignment 1Provide a definition for e.docxamrit47
 
14method in c#
14method in c#14method in c#
14method in c#Sireesh K
 
METHODS IN JAVA.ppt
METHODS IN  JAVA.pptMETHODS IN  JAVA.ppt
METHODS IN JAVA.pptJayanthiM15
 
Presentation of computer
Presentation of computerPresentation of computer
Presentation of computerSabinDhakal13
 
Encapsulating method details in a class [ Choose ] instance vari.pdf
Encapsulating method details in a class [ Choose ] instance vari.pdfEncapsulating method details in a class [ Choose ] instance vari.pdf
Encapsulating method details in a class [ Choose ] instance vari.pdfConint29
 
Learn C# Programming - Encapsulation & Methods
Learn C# Programming - Encapsulation & MethodsLearn C# Programming - Encapsulation & Methods
Learn C# Programming - Encapsulation & MethodsEng Teong Cheah
 

Similar to Daffodil International University Student Explains Java Methods (20)

java Method Overloading
java Method Overloadingjava Method Overloading
java Method Overloading
 
Class 10
Class 10Class 10
Class 10
 
Method overloading
Method overloadingMethod overloading
Method overloading
 
static methods
static methodsstatic methods
static methods
 
Module 4 : methods & parameters
Module 4 : methods & parametersModule 4 : methods & parameters
Module 4 : methods & parameters
 
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
 
SOEN6441.generics.ppt
SOEN6441.generics.pptSOEN6441.generics.ppt
SOEN6441.generics.ppt
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Subprogramms
SubprogrammsSubprogramms
Subprogramms
 
Lecture02 java
Lecture02 javaLecture02 java
Lecture02 java
 
Explain Delegates step by step.
Explain Delegates step by step.Explain Delegates step by step.
Explain Delegates step by step.
 
PSYC 3663 SAFMEDS TERMS – Assignment 1Provide a definition for e.docx
PSYC 3663 SAFMEDS TERMS – Assignment 1Provide a definition for e.docxPSYC 3663 SAFMEDS TERMS – Assignment 1Provide a definition for e.docx
PSYC 3663 SAFMEDS TERMS – Assignment 1Provide a definition for e.docx
 
14method in c#
14method in c#14method in c#
14method in c#
 
METHODS IN JAVA.ppt
METHODS IN  JAVA.pptMETHODS IN  JAVA.ppt
METHODS IN JAVA.ppt
 
Methods intro-1.0
Methods intro-1.0Methods intro-1.0
Methods intro-1.0
 
Delegetes in c#
Delegetes in c#Delegetes in c#
Delegetes in c#
 
Presentation of computer
Presentation of computerPresentation of computer
Presentation of computer
 
Encapsulating method details in a class [ Choose ] instance vari.pdf
Encapsulating method details in a class [ Choose ] instance vari.pdfEncapsulating method details in a class [ Choose ] instance vari.pdf
Encapsulating method details in a class [ Choose ] instance vari.pdf
 
Lec4
Lec4Lec4
Lec4
 
Learn C# Programming - Encapsulation & Methods
Learn C# Programming - Encapsulation & MethodsLearn C# Programming - Encapsulation & Methods
Learn C# Programming - Encapsulation & Methods
 

More from Niloy Biswas

Computer storage & type of storage.
Computer storage & type of storage.Computer storage & type of storage.
Computer storage & type of storage.Niloy Biswas
 
Cyber crime - What is and types.
Cyber crime - What is and types.Cyber crime - What is and types.
Cyber crime - What is and types.Niloy Biswas
 
Regular expression to NFA (Nondeterministic Finite Automata)
Regular expression to NFA (Nondeterministic Finite Automata)Regular expression to NFA (Nondeterministic Finite Automata)
Regular expression to NFA (Nondeterministic Finite Automata)Niloy Biswas
 
UML Diagram - Use-Case diagram, Activity Diagram, Sequence Diagram, Er Diagra...
UML Diagram - Use-Case diagram, Activity Diagram, Sequence Diagram, Er Diagra...UML Diagram - Use-Case diagram, Activity Diagram, Sequence Diagram, Er Diagra...
UML Diagram - Use-Case diagram, Activity Diagram, Sequence Diagram, Er Diagra...Niloy Biswas
 
Cryptography - Block cipher & stream cipher
Cryptography - Block cipher & stream cipherCryptography - Block cipher & stream cipher
Cryptography - Block cipher & stream cipherNiloy Biswas
 
Real life application of data communication
Real life application of data communicationReal life application of data communication
Real life application of data communicationNiloy Biswas
 
Scope management based on project management.
Scope management  based on project management.Scope management  based on project management.
Scope management based on project management.Niloy Biswas
 
Real life use of Discrete Mathematics and Digital electronics.
Real life use of Discrete Mathematics and Digital electronics. Real life use of Discrete Mathematics and Digital electronics.
Real life use of Discrete Mathematics and Digital electronics. Niloy Biswas
 
Application of algorithm in real life
Application of algorithm in real lifeApplication of algorithm in real life
Application of algorithm in real lifeNiloy Biswas
 
Online Movie or theater ticket booking system Details Requirement.
Online Movie or theater ticket booking system Details Requirement.Online Movie or theater ticket booking system Details Requirement.
Online Movie or theater ticket booking system Details Requirement.Niloy Biswas
 
Bad impact of our Education system.
Bad impact of our Education system.Bad impact of our Education system.
Bad impact of our Education system.Niloy Biswas
 
Real life Application of maximum and minimum
Real life Application of maximum and minimumReal life Application of maximum and minimum
Real life Application of maximum and minimumNiloy Biswas
 
History of C Programming Language
History of C Programming LanguageHistory of C Programming Language
History of C Programming LanguageNiloy Biswas
 

More from Niloy Biswas (15)

Computer storage & type of storage.
Computer storage & type of storage.Computer storage & type of storage.
Computer storage & type of storage.
 
Cyber crime - What is and types.
Cyber crime - What is and types.Cyber crime - What is and types.
Cyber crime - What is and types.
 
Regular expression to NFA (Nondeterministic Finite Automata)
Regular expression to NFA (Nondeterministic Finite Automata)Regular expression to NFA (Nondeterministic Finite Automata)
Regular expression to NFA (Nondeterministic Finite Automata)
 
UML Diagram - Use-Case diagram, Activity Diagram, Sequence Diagram, Er Diagra...
UML Diagram - Use-Case diagram, Activity Diagram, Sequence Diagram, Er Diagra...UML Diagram - Use-Case diagram, Activity Diagram, Sequence Diagram, Er Diagra...
UML Diagram - Use-Case diagram, Activity Diagram, Sequence Diagram, Er Diagra...
 
Cryptography - Block cipher & stream cipher
Cryptography - Block cipher & stream cipherCryptography - Block cipher & stream cipher
Cryptography - Block cipher & stream cipher
 
Real life application of data communication
Real life application of data communicationReal life application of data communication
Real life application of data communication
 
Scope management based on project management.
Scope management  based on project management.Scope management  based on project management.
Scope management based on project management.
 
Real life use of Discrete Mathematics and Digital electronics.
Real life use of Discrete Mathematics and Digital electronics. Real life use of Discrete Mathematics and Digital electronics.
Real life use of Discrete Mathematics and Digital electronics.
 
Application of algorithm in real life
Application of algorithm in real lifeApplication of algorithm in real life
Application of algorithm in real life
 
Graph
GraphGraph
Graph
 
Tic tac toe
Tic tac toeTic tac toe
Tic tac toe
 
Online Movie or theater ticket booking system Details Requirement.
Online Movie or theater ticket booking system Details Requirement.Online Movie or theater ticket booking system Details Requirement.
Online Movie or theater ticket booking system Details Requirement.
 
Bad impact of our Education system.
Bad impact of our Education system.Bad impact of our Education system.
Bad impact of our Education system.
 
Real life Application of maximum and minimum
Real life Application of maximum and minimumReal life Application of maximum and minimum
Real life Application of maximum and minimum
 
History of C Programming Language
History of C Programming LanguageHistory of C Programming Language
History of C Programming Language
 

Recently uploaded

(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 

Recently uploaded (20)

(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 

Daffodil International University Student Explains Java Methods

  • 1.
  • 2. Daffodil International University  Submitted By Niloy Biswas (171-35-225)  Submitted to  S A M Matiur Rahman Associate Head Department of SWE Daffodil International University
  • 3. Methods  A program that provides some functionality can be long and contains many statements  A method takes input, performs actions, and produces output  In Java, each method is defined within specific class
  • 4. General from of Method Int square ( int num1, int num2){ //body of method } Type name parameter
  • 5. General from of Method • The parameter list is a sequence of type and identifier pairs separated by commas. • Parameters are essentially variables that receives the value of the arguments passed to the method when it is called. • If the method has no parameters, then the parameter list will be empty. • Methods that have a return type other than void return a value to the calling routine using the following form of return statement.
  • 6. Method declaration public static void main (String[ ] args){ System.out.println(“This is method body”); } ParameterModifier Modifier ReturnType Nameof Method Methodbody
  • 7. Adding a Method to class class Box{ float width; float height; float depth; float volume() { return width * height * depth; } }