<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ca">
	<id>https://cacauet.org/wiki/index.php?action=history&amp;feed=atom&amp;title=POO_Sobrec%C3%A0rrega</id>
	<title>POO Sobrecàrrega - Historial de revisió</title>
	<link rel="self" type="application/atom+xml" href="https://cacauet.org/wiki/index.php?action=history&amp;feed=atom&amp;title=POO_Sobrec%C3%A0rrega"/>
	<link rel="alternate" type="text/html" href="https://cacauet.org/wiki/index.php?title=POO_Sobrec%C3%A0rrega&amp;action=history"/>
	<updated>2026-05-04T10:01:38Z</updated>
	<subtitle>Historial de revisió per a aquesta pàgina del wiki</subtitle>
	<generator>MediaWiki 1.34.0</generator>
	<entry>
		<id>https://cacauet.org/wiki/index.php?title=POO_Sobrec%C3%A0rrega&amp;diff=1423&amp;oldid=prev</id>
		<title>Enric: Es crea la pàgina amb «La sobrecàrrega és la capacitat de definir el mateix mètode diversos cops en funció del tipus d'arguments que se li passen.  * http://en.wikipedia.org/wiki/Function_o…».</title>
		<link rel="alternate" type="text/html" href="https://cacauet.org/wiki/index.php?title=POO_Sobrec%C3%A0rrega&amp;diff=1423&amp;oldid=prev"/>
		<updated>2012-10-03T16:36:50Z</updated>

		<summary type="html">&lt;p&gt;Es crea la pàgina amb «La sobrecàrrega és la capacitat de definir el mateix mètode diversos cops en funció del tipus d&amp;#039;arguments que se li passen.  * http://en.wikipedia.org/wiki/Function_o…».&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Pàgina nova&lt;/b&gt;&lt;/p&gt;&lt;div&gt;La sobrecàrrega és la capacitat de definir el mateix mètode diversos cops en funció del tipus d'arguments que se li passen.&lt;br /&gt;
&lt;br /&gt;
* http://en.wikipedia.org/wiki/Function_overloading&lt;br /&gt;
&lt;br /&gt;
En C++, per exemple:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class Punt {&lt;br /&gt;
   private:&lt;br /&gt;
     int posx;&lt;br /&gt;
     int posy;&lt;br /&gt;
   public:&lt;br /&gt;
     void setCoord(int x, int y) {&lt;br /&gt;
        posx = x;&lt;br /&gt;
        posy = y;&lt;br /&gt;
     }&lt;br /&gt;
     void setCoord(int a) {&lt;br /&gt;
        posx = a;&lt;br /&gt;
        posy = a;&lt;br /&gt;
     }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Com es pot veure, serà diferent si faig la crida a una funció o a l'altra:&lt;br /&gt;
 Punt p;&lt;br /&gt;
 p.setCoord(10,20);&lt;br /&gt;
En canvi, cridaré a la 2a funció si faig (els 2 valors valdran &amp;quot;10&amp;quot;):&lt;br /&gt;
 p.setCoord(10);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
En Python, de nou, no és rellevant, ja que l'argument no té un tipus predefinit. Per simular el comportament de la sobrecàrrega utilitzem els [[Python: keyworded arguments]].&lt;/div&gt;</summary>
		<author><name>Enric</name></author>
		
	</entry>
</feed>