பல்லுருத்தோற்றம் (கணிப்பொறி அறிவியல்): திருத்தங்களுக்கு இடையிலான வேறுபாடு
உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
சி AntanO பக்கம் பல்லுருவாக்கம் (பொருள் நோக்கு நிரலாக்கம்)-ஐ [[பல்லுருத்தோற்றம் (கணிப்பொறி அறிவியல்... |
சிNo edit summary |
||
வரிசை 1:
பொருள் நோக்கு நிரலாக்கத்தில், '''பல்லுருவாக்கம்''' (''Polymorphism'') என்பது ஒரு வகுப்பின் செயலிகளை, மாறிகளை, அல்லது பொருட்களை அந்த வகுப்பின் subclasses தமது தேவைகளுக்கு ஏற்றமாதிரி நிறைவேற்ற முடியும் என்ற கூற்றாகும்.
▲பொருள் நோக்கு நிரலாக்கத்தில், '''பல்லுருவாக்கம்''' (Polymorphism) என்பது ஒரு வகுப்பின் செயலிகளை, மாறிகளை, அல்லது பொருட்களை அந்த வகுப்பின் subclasses தமது தேவைகளுக்கு ஏற்றமாதிரி நிறைவேற்ற முடியும் என்ற கூற்றாகும்.
== எடுத்துக்காட்டுக்கள் ==
=== பி.எச்.பி ===
<
<?php
வரி 57 ⟶ 56:
?>
</syntaxhighlight>
=== பெர்ள் ===
Polymorphism in [[Perl]] is inherently straightforward to write because of the language's use of [[Sigil (computer programming)|sigils]] and [[Reference (computer science)|references]]. This is the <code>Animal</code> example in standard OO Perl:
<
package Animal;
sub new {
my ($class, $name) = @_;
bless {name => $name}, $class;
}
package Cat;
வரி 92 ⟶ 91:
# Mr. Mistoffelees: Meow
# Lassie: Woof! Woof!
</syntaxhighlight>
This means that Perl can also apply polymorphism to the method call. The example below is written using the <code>Moose</code> module in order to show modern OO practises in Perl (it is not required for method polymorphism):
<
{
package Animal;
வரி 139 ⟶ 138:
# Lassie: talk => Woof! Woof!
# Lassie: likes => Bone
</syntaxhighlight>
== வெளி இணைப்புகள் ==
|