bakit mas prefer ang method sa oop paps? at pwede bang gamitin ang function sa oop? btw paps walang mas clear na explanation sorry papsIn practice they can mean the same thing.
However "method" is more prevalently used in Object Oriented Programming context like Java when talking about object behaviors.
Functions are often used to mean independent methods/behaviors. No object attachment. Functions are often used in non-OOP languages. However there are languages that consider functions as first class objects.
At the end of the day prefer pure functions or objects that follow SRP.
class Sample
{
public:
void FunctionB();
}
void FunctionA()
{
}
int main(int argc, char** argv)
{
Sample sample();
FunctionA(); // Function
sample.FunctionB(); // Method (Function parin to pero method na ang tawag dahil sa paraan ng implementation)
return 0;
}