A function is equivalent to a subroutine in most programming languages. Both subroutines and functions are used to perform a specific task or set of operations within a program. However, the term "subroutine" is more commonly associated with older programming languages, while "function" is the more widely used term in modern programming languages.
An accessor, on the other hand, is different from a subroutine or function. An accessor is a type of function that is specifically used to retrieve or access the value of a data member or object property in object-oriented programming languages. Accessors are used to provide controlled and consistent access to data within an object.
which of the following is equivilent to a subroutine depending on the programming language
model
function
accessor
1 answer