Programming Logic and Design
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
Admin
Admin
Admin
Posts : 7
Join date : 2018-08-07
https://jenreyes.forumotion.com

What is a method and it's parts? Empty 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.

What is a method and it's parts? Screen10


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


Last edited by Admin on Mon Aug 20, 2018 2:21 pm; edited 3 times in total
avatar
Myleinne
Guru
Guru
Posts : 10
Join date : 2018-08-07

What is a method and it's parts? Empty 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?


Last edited by Myleinne on Tue Aug 07, 2018 1:46 pm; edited 1 time in total
avatar
Myleinne
Guru
Guru
Posts : 10
Join date : 2018-08-07

What is a method and it's parts? Empty 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?
avatar
Myleinne
Guru
Guru
Posts : 10
Join date : 2018-08-07

What is a method and it's parts? Empty 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?
avatar
Myleinne
Guru
Guru
Posts : 10
Join date : 2018-08-07

What is a method and it's parts? Empty 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?
avatar
Myleinne
Guru
Guru
Posts : 10
Join date : 2018-08-07

What is a method and it's parts? Empty 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?
avatar
Nicole12
Guru
Guru
Posts : 11
Join date : 2018-08-08

What is a method and it's parts? Empty 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.
avatar
Nicole12
Guru
Guru
Posts : 11
Join date : 2018-08-08

What is a method and it's parts? Empty Re: What is a method and it's parts?

Wed Aug 08, 2018 1:10 pm
Myleinne wrote:pag po nakalimutan ko mag lagay ng return statement at the end ng method ano po mangyayari?
may chance na mag ka stack overflow?
avatar
Nicole12
Guru
Guru
Posts : 11
Join date : 2018-08-08

What is a method and it's parts? Empty Re: What is a method and it's parts?

Wed Aug 08, 2018 1:11 pm
Myleinne wrote:isang beses lang po ba pwede magamit ang method?
hindi naman po pwede naman tayo mag call ng method from another method
avatar
Nicole12
Guru
Guru
Posts : 11
Join date : 2018-08-08

What is a method and it's parts? Empty Re: What is a method and it's parts?

Wed Aug 08, 2018 1:12 pm
Myleinne wrote:ano po advantages ng method sa pag gawa ng program?
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.
avatar
Maridel
Guru
Guru
Posts : 10
Join date : 2018-08-08

What is a method and it's parts? Empty 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.
avatar
Maridel
Guru
Guru
Posts : 10
Join date : 2018-08-08

What is a method and it's parts? Empty 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.
avatar
Maridel
Guru
Guru
Posts : 10
Join date : 2018-08-08

What is a method and it's parts? Empty 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.
avatar
Maridel
Guru
Guru
Posts : 10
Join date : 2018-08-08

What is a method and it's parts? Empty Re: What is a method and it's parts?

Wed Aug 08, 2018 2:03 pm
what is a method signature?
avatar
GraceAnn
Guru
Guru
Posts : 10
Join date : 2018-08-08

What is a method and it's parts? Empty Re: What is a method and it's parts?

Wed Aug 08, 2018 4:54 pm
Myleinne wrote:pag po nakalimutan ko mag lagay ng return statement at the end ng method ano po mangyayari?
according to the book i read, structured programming requires that a method must contain a single entry point and single exit point. Smile
avatar
GraceAnn
Guru
Guru
Posts : 10
Join date : 2018-08-08

What is a method and it's parts? Empty 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.
avatar
GraceAnn
Guru
Guru
Posts : 10
Join date : 2018-08-08

What is a method and it's parts? Empty Re: What is a method and it's parts?

Tue Aug 14, 2018 8:03 am
Maridel wrote:what is a method signature?
In the Java programming language, a method signature is the method name and the number, type and order of its parameters. Razz
avatar
GraceAnn
Guru
Guru
Posts : 10
Join date : 2018-08-08

What is a method and it's parts? Empty Re: What is a method and it's parts?

Tue Aug 14, 2018 8:07 am
Myleinne wrote:isang beses lang po ba pwede magamit ang method?
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)
avatar
GraceAnn
Guru
Guru
Posts : 10
Join date : 2018-08-08

What is a method and it's parts? Empty Re: What is a method and it's parts?

Tue Aug 14, 2018 8:08 am
Myleinne wrote:sa java and C# lang po ba ginagamit yung method?
hindi po ang other name nya sa ibang language is module or function Wink
avatar
Nicolai
Newbie
Newbie
Posts : 4
Join date : 2018-08-18

What is a method and it's parts? Empty Re: What is a method and it's parts?

Mon Aug 20, 2018 2:29 pm
what is the difference between method and functions?
Sponsored content

What is a method and it's parts? Empty Re: What is a method and it's parts?

Back to top
Permissions in this forum:
You cannot reply to topics in this forum