Methods Flashcards

1
Q

Parameter passing in method

A

NEED DATA TYPE IN PARAMETER

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Returning from method

A

Public “data type” methodName

At the end of method

Return ; }

Can have return statement within if-elif-else statement.

Code finishes when return statement is read

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is method?

A

The part where you’re actually having code written for a method type. I.e functions

Class {

      Method {

}}

Class main {

  Call methods;

}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Local variables

A

In methods, they contain local variables and if you want something to use outside got to return it

Basically just a function in python.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Instance variable va local variables

A

Instance variable belongs to a class.

Local variable belongs to a method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly