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"
16 questions
Loops Quiz
Quiz
•
9th - 12th Grade
20 questions
קלט פלט משתנים והוראות השמה
Quiz
•
7th Grade - University
15 questions
Soal Java
Quiz
•
11th Grade - University
15 questions
Area With Arrays
Quiz
•
10th - 12th Grade
20 questions
TGT APCSA
Quiz
•
11th Grade
15 questions
JavaScript and Graphics
Quiz
•
9th - 12th Grade
16 questions
Loops
Quiz
•
5th - 12th Grade
20 questions
APCSA Arrays
Quiz
•
9th - 12th Grade
15 questions
Multiplication Facts
Quiz
•
4th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions
Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines
Quiz
•
Professional Development
12 questions
Dividing Fractions
Quiz
•
6th Grade