Dato il seguente codice:
int a =Integer.parseInt(s);
Quali/e affermazioni/e sono/è corretta?
Java Base
Quiz
•
Computers
•
9th - 12th Grade
•
Hard
Ilaria Bertoletti
Used 47+ times
FREE Resource
19 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Dato il seguente codice:
int a =Integer.parseInt(s);
Quali/e affermazioni/e sono/è corretta?
int è il tipo primitivo
Integer è la wrapper class
L'istruzione è errata e si risolve correttamente con il cast esplicito
int a = (int)s
Nessuna delle precedenti
2.
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
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Per rappresentare i numeri in virgola mobile in Java il default è
float
non c'è nessun default
double
int
4.
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;
5.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Quali modi sono corretti per dichiarare una variabile di tipo reale?
float num = 14.9f;
float num = 14.9;
float num;
double num = 14.9d;
6.
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
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Come posso acquisire un solo carattere utilizzando la classe Scanner?
char c = sc.nextLine().charAt(0);
char c = sc.nextChar();
char c = sc.nextLine(0);
Nessuna delle precedenti
20 questions
Foglio_Elettronico_base
Quiz
•
10th Grade
20 questions
VERIFICA M5 Sistemi operativi
Quiz
•
10th Grade
15 questions
A4 - Il linguaggi di programmazione C++ SELEZIONE
Quiz
•
2nd Grade - University
16 questions
Loops
Quiz
•
5th - 12th Grade
20 questions
File system in Windows 7
Quiz
•
9th Grade - University
15 questions
NETIQUETTE
Quiz
•
9th - 12th Grade
18 questions
Hardware
Quiz
•
8th - 12th Grade
18 questions
Linguaggio HTML
Quiz
•
10th 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
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
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