18.09.2013 Views

Introducció al desenvolupament de programari - 6 tasses de Java ...

Introducció al desenvolupament de programari - 6 tasses de Java ...

Introducció al desenvolupament de programari - 6 tasses de Java ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

© FUOC • XP06/M2010/01166<br />

ANOTACIONES<br />

6<br />

Programari lliure<br />

5. Programació en <strong>Java</strong> ............................................. 303<br />

5.1. <strong>Introducció</strong> ..................................................... 303<br />

5.2. Origen <strong>de</strong> <strong>Java</strong> ............................................... 306<br />

5.3. Característiques gener<strong>al</strong>s <strong>de</strong> <strong>Java</strong> .................... 307<br />

5.4. L’entorn <strong>de</strong> <strong><strong>de</strong>senvolupament</strong> <strong>de</strong> <strong>Java</strong> ............. 310<br />

5.4.1. La plataforma <strong>Java</strong> ............................. 312<br />

5.4.2. El nostre primer programa en <strong>Java</strong> ...... 313<br />

5.4.3. Les instruccions bàsiques<br />

i els comentaris .................................. 314<br />

5.5. Diferències entre C++ i <strong>Java</strong> .......................... 315<br />

5.5.1. Entrada/sortida .................................. 315<br />

5.5.2. El preprocessador ............................... 318<br />

5.5.3. La <strong>de</strong>claració <strong>de</strong> variables<br />

i constants .......................................... 319<br />

5.5.4. Els tipus <strong>de</strong> da<strong>de</strong>s ............................... 319<br />

5.5.5. La gestió <strong>de</strong> variables dinàmiques ....... 320<br />

5.5.6. Les funcions i el pas <strong>de</strong> paràmetres ..... 322<br />

5.6. Les classes en <strong>Java</strong> ......................................... 323<br />

5.6.1. Declaració d’objectes ......................... 324<br />

5.6.2. Accés <strong>al</strong>s objectes ............................... 325<br />

5.6.3. Destrucció d’objectes .......................... 326<br />

5.6.4. Constructors <strong>de</strong> còpia ......................... 326<br />

5.6.5. Herència simple i herència múltiple ..... 327<br />

5.7. Herència i polimorfisme .................................. 328<br />

5.7.1. Les referències this i super ............. 328<br />

5.7.2. La classe Object ............................... 328<br />

5.7.3. Polimorfisme ...................................... 329<br />

5.7.4. Classes i mèto<strong>de</strong>s abstractes ............... 329<br />

5.7.5. Classes i mèto<strong>de</strong>s fin<strong>al</strong>s ...................... 330<br />

5.7.6. Interfícies ........................................... 331<br />

5.7.7. Paquets .............................................. 333<br />

5.7.8. L’API (applications programming<br />

interface) <strong>de</strong> <strong>Java</strong> ............................... 334<br />

5.8. El paradigma <strong>de</strong> la programació orientada<br />

a incidències .................................................. 335<br />

5.8.1. Les incidències en <strong>Java</strong> ....................... 336<br />

5.9. Fils d’execució ................................................ 338<br />

5.9.1. Creació <strong>de</strong> fils d’execució ................... 339<br />

5.9.2. Cicle <strong>de</strong> vida <strong>de</strong>ls fils d’execució ......... 342<br />

5.10. Les miniaplicacions ......................................... 343<br />

5.10.1. Cicle <strong>de</strong> vida <strong>de</strong> les miniaplicacions .... 344<br />

5.10.2. Manera d’incloure miniaplicacions<br />

en una pàgina HTML .......................... 345<br />

5.10.3. La nostra primera miniaplicació<br />

en <strong>Java</strong> .............................................. 346

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!