Quale/i dei seguenti codici è corretto per visualizzare il contenuto del seguente array
int [] v = {2, 5, 7, 12, 1};
Algoritmi Java
Quiz
•
Computers
•
11th Grade
•
Hard
Andrea Accordino
Used 30+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Quale/i dei seguenti codici è corretto per visualizzare il contenuto del seguente array
int [] v = {2, 5, 7, 12, 1};
for(int i=0;i<v.length;i++)
System.out.println(v[i]);
for(int elem:v)
System.out.println(elem)
for(int=0;i<v.length();i++)
System.out.println(v[i];
Nessuna delle precedenti
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
quale soluzione è la dichiarazione di una costante di tipo int?
static final int NUM = 6;
static int NUM = 6;
static int NUM = 6;
static final int NUM 6;
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Cosa produce in output il seguente codice e perchè?
String s1=new String("Ciao mondo");
String s2=new String("Ciao mondo");
if(s1==s2)
System.out.print("True");
else
System.out.print("False");
True, perchè il contenuto delle due stringhe è uguale
False, perchè s2 è minore rispetto a s1
True, perchè viene confrontato il tipo delle due variabili
False, perchè vengono confrontati gli indirizzi e non il contenuto
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
come posso acquisire con il metodo scanner un solo carattere?
char c = sc.nextLine().charAt(0);
char c = sc.nextChar();
char c = sc.nextLine(0);
Nessuna delle precedenti
5.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
quali tra queste dichiarazioni di array sono sbagliate?
int Array[ ];
[ ] int array;
int [ ] array;
int array[];
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Quale tra le seguenti istruzioni è quella corretta per generare un numero intero compreso tra 0 e 50?
int n = (Math.random()* 51)
int n = (int) (Math.random()* 51);
int n = (int) Math.random()* 50;
int n = Math.random()* 50;
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
La seguente riga di codice quale output produce?
int risultato = 5;
System.out.println("Il risultato e' "+risultato+1)
"Il risultato e' 5"
errore
"Il risultato e' 6"
"Il risultato e' 51"
20 questions
TGT APCSA
Quiz
•
11th Grade
15 questions
JavaScript and Graphics
Quiz
•
9th - 12th Grade
17 questions
PROVA 2º bimestre
Quiz
•
11th Grade
22 questions
IST CodeHS Unit 8 JavaScript Review
Quiz
•
9th - 12th Grade
23 questions
Java
Quiz
•
11th Grade - University
15 questions
Variables Java
Quiz
•
10th - 12th Grade
15 questions
Soal Java
Quiz
•
11th Grade - University
15 questions
Programación con Java
Quiz
•
9th - 11th Grade
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Taxes
Quiz
•
9th - 12th Grade
17 questions
Parts of Speech
Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression
Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing
Quiz
•
9th - 12th Grade
10 questions
Identifying equations
Quiz
•
KG - University