Programming Languages
C++
Subjective
Mar 13, 2013
Which feature of Perl provides code reusability ? Give any example of that feature.
Detailed Explanation
Inheritance feature of Perl provides code reusability. In inheritance, the child class can use the methods and property of parent class
Package Parent;
Sub foo
{
print("Inside A::foo\n");
}
package Child;
@ISA = (Parent);
package main;
Child->foo();
Child->bar();
Discussion (0)
No comments yet. Be the first to share your thoughts!
Share Your Thoughts