Você está na página 1de 1

Programação Orientada a Objetos

1. Indique, para cada uma das afirmações, se é verdadeira ou falsa. Justifique as


falsas.
a) Os elementos de um array podem ser de tipos diferentes
b) Num array de 5 elementos os índices, em Java variam de 1 a 5

State, for each statement, whether it is true or false. Justify the false ones.
a) The elements of an array can be of different types
b) In an array of 5 elements, the indexes in Java vary from 1 to 5

2. Considere as seguintes instruções. Indique o significado de cada uma.


Consider the following instructions. State the meaning of each one
String [] names;
names = new String [10];

3. Indique, qual a diferença dos resultados dos 2 programas abaixo. Justifique


What is the difference between the results of the 2 programs below? Justify

4. Considere o seguinte array/ Consider the following array

10 12 14 10 16 11 23 12 19

a) Declare e instancie este array em java


b) Escreva um conjunto de instruções em Java que permitam contar o nº de
vezes que 10 existe no array.
c) Escreva um conjunto de instruções em Java que permitam indicar a posição do
array que contém o maior valor (assuma que esse valor só ocorre uma vez)

a) Declare and instantiate this array in java


b) Write a set of instructions in Java that allow counting the number of times that 10
exists in the array.
c) Write a set of instructions in Java that allow you to indicate the position of the array
that contains the highest value (assume that this value only occurs once)

Você também pode gostar