Quiz
Sem título
Crie uma conta grátis para terminar este quiz
Salve seu progresso e veja sua nota final.
Já tem uma conta? Inicie sessão
Perguntas do quiz (10)
1Which one is not correct?
- AString shoes[] = new String[];
- Bint [] digits = new int[5];
- CPlant plantSpecies[] = new Plant[22];
- Ddouble weightClass[] = new double[2];
2You can remove 'memory slots' from an array if they are no longer needed.
- AVerdadeiro
- BFalso
3What will be the print out?
char alphabet[] = new char[26];
alphabet[0] = 'A';
alphabet[1]= 'B';
alphabet[2] = 'C';
System.out.println(alphabet[1]);- AA
- BB
- CC
- DNone of the above, it will print memory address
4When you create an Array, all elements inside must be the same data type.
- AVerdadeiro
- BFalso
5Choose the correct 'formula' for creating an array:
- Adata type + variable[] = new variable[n];
- Bdata type + [] + variable = new data type[n];
- Cvariable + data type[] = new data type[n]l
- Dvariable + [] + data type = new variable[n]
6This code will run:
String names[] = new String[4];
String[0] = "4";- ATrue
- BFalse
7Loops are controlled by boolean statements.
- AVerdadeiro
- BFalso
8What is the correct way to calculate the length of the following array?
String names[] = new String[5];- Aint n = names.length();
- Bint n = getLengthOfNames[];
- Cint n = names.length
- Dint n = names.trim().length()
9What is the flaw in this line of code?
int index= 0;
while( index < words.length )
{
System.out.println(words[index]);
}- AThis is not the correct format to write a while loop
- BIndex is not incrementing so the loop is flawed
- CCondition is never true so it can not evaluate
- DThere is a synatx error
10What will print out?
Movie movieTitle[] = new Movie[5];
movieTitle[0] = "Nacho Libre";
movieTitle[2] = "John Wick";
movieTitle[3]= "Serenity';
System.out.println(movieTitle[2]);- Anull
- B"John Wick"
- CThe memory address for "John Wick"
- DSyntax Error
Informações
- Descrição
- Quiz sobre Sem título, criado por Athena Kozak em 15-03-2019.
- Autor
- Athena Kozak
- Idioma
- English
- Visualizações
- 2
- Avaliação
- Ainda sem avaliações Avalie este quiz