What is a method and it's parts?
+2
Myleinne
Admin
6 posters
What is a method and it's parts?
Tue Aug 07, 2018 12:44 pm
In object-oriented programming languages such as Java and C#, modules are most often
called methods.
A method is a program module that contains a series of statements that carry out a task;
you can invoke or call a method from another program or method. The calling program
or method is the called method’s client .
Parts of a method
1.Method header (sometimes also called the method declaration)
It contains identifying information about the method.
2. Method body
The body contains the method’s implementation —the
statements that carry out the method’s tasks.
3. Method return statement
returns control to the calling method after a method
executes.
Variables and constants can be declared within a method
A data item declared in a
method is local to that method, meaning it is in scope, or recognized only within that
method.The opposite of local is global. When a data item is known to all of a program’s methods
or modules, it is a global data item
called methods.
A method is a program module that contains a series of statements that carry out a task;
you can invoke or call a method from another program or method. The calling program
or method is the called method’s client .
Parts of a method
1.Method header (sometimes also called the method declaration)
It contains identifying information about the method.
2. Method body
The body contains the method’s implementation —the
statements that carry out the method’s tasks.
3. Method return statement
returns control to the calling method after a method
executes.
Variables and constants can be declared within a method
A data item declared in a
method is local to that method, meaning it is in scope, or recognized only within that
method.The opposite of local is global. When a data item is known to all of a program’s methods
or modules, it is a global data item
- MyleinneGuru
- Posts : 10
Join date : 2018-08-07
Re: What is a method and it's parts?
Tue Aug 07, 2018 1:45 pm
sa java and C# lang po ba ginagamit yung method?
- MyleinneGuru
- Posts : 10
Join date : 2018-08-07
Re: What is a method and it's parts?
Tue Aug 07, 2018 1:46 pm
can you give me some rules po to create a method?
- MyleinneGuru
- Posts : 10
Join date : 2018-08-07
Re: What is a method and it's parts?
Tue Aug 07, 2018 1:47 pm
isang beses lang po ba pwede magamit ang method?
- MyleinneGuru
- Posts : 10
Join date : 2018-08-07
Re: What is a method and it's parts?
Tue Aug 07, 2018 1:56 pm
ano po advantages ng method sa pag gawa ng program?
- MyleinneGuru
- Posts : 10
Join date : 2018-08-07
Re: What is a method and it's parts?
Tue Aug 07, 2018 1:57 pm
pag po nakalimutan ko mag lagay ng return statement at the end ng method ano po mangyayari?
- Nicole12Guru
- Posts : 11
Join date : 2018-08-08
Re: What is a method and it's parts?
Wed Aug 08, 2018 1:09 pm
Myleinne wrote:sa java and C# lang po ba ginagamit yung method?
yung method and module ay iisa lang kilala lang sya sa java at C# na method.
- Nicole12Guru
- Posts : 11
Join date : 2018-08-08
Re: What is a method and it's parts?
Wed Aug 08, 2018 1:10 pm
may chance na mag ka stack overflow?Myleinne wrote:pag po nakalimutan ko mag lagay ng return statement at the end ng method ano po mangyayari?
- Nicole12Guru
- Posts : 11
Join date : 2018-08-08
Re: What is a method and it's parts?
Wed Aug 08, 2018 1:11 pm
hindi naman po pwede naman tayo mag call ng method from another methodMyleinne wrote:isang beses lang po ba pwede magamit ang method?
- Nicole12Guru
- Posts : 11
Join date : 2018-08-08
Re: What is a method and it's parts?
Wed Aug 08, 2018 1:12 pm
Less code has to be written. A single procedure can be developed for reuse, eliminating the need to retype the code many times. Programs can be designed more easily because a small team deals with only a small part of the entire code.Myleinne wrote:ano po advantages ng method sa pag gawa ng program?
- MaridelGuru
- Posts : 10
Join date : 2018-08-08
Re: What is a method and it's parts?
Wed Aug 08, 2018 1:46 pm
A method is a code block that contains a series of statements. A program causes the statements to be executed by calling the method and specifying any required method arguments. In C#, every executed instruction is performed in the context of a method. The Main method is the entry point for every C# application and it is called by the common language runtime (CLR) when the program is started.
- MaridelGuru
- Posts : 10
Join date : 2018-08-08
Re: What is a method and it's parts?
Wed Aug 08, 2018 1:48 pm
additional info: A return type of a method is not part of the signature of the method for the purposes of method overloading. However, it is part of the signature of the method when determining the compatibility between a delegate and the method that it points to.
- MaridelGuru
- Posts : 10
Join date : 2018-08-08
Re: What is a method and it's parts?
Wed Aug 08, 2018 1:57 pm
methods have return types that provide information about data the methods returns. in some languages like C++ a default return type is implied if no return type is listed.
- MaridelGuru
- Posts : 10
Join date : 2018-08-08
Re: What is a method and it's parts?
Wed Aug 08, 2018 2:03 pm
what is a method signature?
- GraceAnnGuru
- Posts : 10
Join date : 2018-08-08
Re: What is a method and it's parts?
Wed Aug 08, 2018 4:54 pm
according to the book i read, structured programming requires that a method must contain a single entry point and single exit point.Myleinne wrote:pag po nakalimutan ko mag lagay ng return statement at the end ng method ano po mangyayari?
- GraceAnnGuru
- Posts : 10
Join date : 2018-08-08
Re: What is a method and it's parts?
Wed Aug 08, 2018 4:56 pm
additional info: The rules for naming methods are different in every programming language, but they
often are similar to the language’s rules for variable names. In this text, method names are
followed by a set of parentheses.
often are similar to the language’s rules for variable names. In this text, method names are
followed by a set of parentheses.
- GraceAnnGuru
- Posts : 10
Join date : 2018-08-08
Re: What is a method and it's parts?
Tue Aug 14, 2018 8:03 am
In the Java programming language, a method signature is the method name and the number, type and order of its parameters.Maridel wrote:what is a method signature?
- GraceAnnGuru
- Posts : 10
Join date : 2018-08-08
Re: What is a method and it's parts?
Tue Aug 14, 2018 8:07 am
One of the most important capabilities that a method provides is method overriding. The same name can be used for multiple different kinds of classes. This allows the sending objects to invoke behaviors and to delegate the implementation of those behaviors to the receiving object. (wikipedia)Myleinne wrote:isang beses lang po ba pwede magamit ang method?
- GraceAnnGuru
- Posts : 10
Join date : 2018-08-08
Re: What is a method and it's parts?
Tue Aug 14, 2018 8:08 am
hindi po ang other name nya sa ibang language is module or functionMyleinne wrote:sa java and C# lang po ba ginagamit yung method?
- NicolaiNewbie
- Posts : 4
Join date : 2018-08-18
Re: What is a method and it's parts?
Mon Aug 20, 2018 2:29 pm
what is the difference between method and functions?
Permissions in this forum:
You cannot reply to topics in this forum
|
|