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
15 questions
java servlet
Quiz
•
12th Grade
15 questions
Test JAVA - 1
Quiz
•
12th Grade
15 questions
OOP in java
Quiz
•
12th Grade
17 questions
UsoDiWord_01_Generale
Quiz
•
6th - 12th Grade
15 questions
NETIQUETTE
Quiz
•
9th - 12th Grade
20 questions
Sfida informatica
Quiz
•
6th - 10th Grade
18 questions
Hardware
Quiz
•
8th - 12th Grade
17 questions
FormazioneSicurezzaSpecifica_Mod. 3.1
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
25 questions
Spanish preterite verbs (irregular/changed)
Quiz
•
9th - 10th Grade
10 questions
Identify Slope and y-intercept (from equation)
Quiz
•
8th - 9th Grade
10 questions
Juneteenth: History and Significance
Interactive video
•
7th - 12th Grade
8 questions
"Keeping the City of Venice Afloat" - STAAR Bootcamp, Day 1
Quiz
•
9th - 12th Grade
26 questions
June 19th
Quiz
•
4th - 9th Grade
20 questions
Distance, Midpoint, and Slope
Quiz
•
10th Grade
20 questions
Figurative Language Review
Quiz
•
10th Grade
27 questions
STAAR English 1 Review
Quiz
•
9th Grade