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"
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Array

Quiz
•
10th - 12th Grade
16 questions
Java Chapter 1 CS2

Quiz
•
9th - 12th Grade
17 questions
Unit 7 Review 1

Quiz
•
9th - 12th Grade
20 questions
Functions With Parameters and Returns

Quiz
•
9th - 12th Grade
20 questions
PAS SEMESTER 1 smkn 4 tangerang

Quiz
•
11th Grade
15 questions
Java Variables, Input and Output

Quiz
•
10th - 12th Grade
20 questions
SKT4-1.3: PEMBOLEH UBAH, PEMALAR DAN JENIS DATA

Quiz
•
10th - 11th Grade
15 questions
SIOT - Komunikasi Data Serial UART

Quiz
•
11th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade