Font size
WorksheetsJava Code italian - settimana 4 corso DSTECH
Total questions: 90
Worksheet time: 2hrs 22mins
Quali delle seguenti affermazioni relative alle interfacce java è vera?
una interfaccia può definire campi non statici
i metodi di un'interfaccia hanno visibilità di accesso package
i campi di una interfaccia sono final
una interfaccia può estendere una classe astratta
Nel linguaggio Java, a cosa servono i costruttori?
Definire un metodo di un oggetto
Definire il codice per l'implementazione delle interfacce
definire le istruzioni da eseguire quando si istanzia un oggetto
È un metodo particolare per invocare il super()
cos'è il bytecode
La quantità di memoria allocata dinamicamente
La quantità di memoria allocata staticamente per le code di stampa
Il contenuto di un file di estensione class
il codice ASCII o UNICODE dei singoli Byte
Una classe è...
L'istanza di un oggetto
L'insieme delle dichiarazioni degli oggetti
Un modello astratto per una famiglia di oggetti con caratteristiche simili
Il nome che rappresenta un oggetto
Un programma contenente il metodo main()
Un oggetto è
colui che manda un messaggio
una istanza di una classe
un insieme di caratteristiche simili
una classe non astratta
un programma che rappresenta una classe
Un array monodimensionale (o vettore) è...
un insieme di valori ordinati
un insieme di dati dello stesso tipo
un insieme di dati individuabili tramite indice
una serie di valori vuoti
una serie ordinata di interi
Which data type gets returned from length() method in String class?
double
String
int
number
Class Cat extends Animal. Which is NOT a valid declaration?
Cat x = new Cat();
Animal X = new Animal();
Cat x = new Animal();
Animal x = new Cat();
Which statement below is the correct way to retrieve the first element in the nums ArrayList?
nums.get(0)
nums[0]
nums(0)
nums[1]
What will print when the following code executes?
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(7);
list.add(8);
list.add(9);
System.out.println(list.remove(0));
7
8
9
0
2
5
7
9
13
20
IronMan or Thor?
What is output by the code? Pretend it says System.out.println
2
3
4
5
6
123
12
1234
12345
4321
Consider the following code segment:
Line 1: int a = 10;
Line 2: double b = 10.7;
Line 3: double c = a + b;
Line 4: int d = a + c;
Line 5: System.out.println(c + " " + d);
What will be output as a result of executing the code segment?
20 20
20.0 30
20.7 31
20.7 30.7
Nothing will be printed because of a compile-time error.
The variable "trash" will store what value?
2
10
1
3
What will the code print?
Jimmy
Timmy
Potatoes
A blank line
What value is printed to the console?
true
W
false
L
What value is printed to the console?
This restaurant is not my favourite.
This restaurant is good.
This restaurant is fantastic!
I've never dined at this restaurant.
3
a = {0, 2, 3, 4} and v = 2?
Cosa definisco quando implemento l'interfaccia comparable
un ordinamento al momento
un ordinamento naturale
la possibilità di salvare su file
la possibilità di usare una lista
L'interfaccia ________ serve a darci la possibilità di salvare su stream oggetti da noi costruiti
Comparable
Saverizable
Serializable
Corruptable
Cosa è una NullPointerException
Una eccezione generata da un oggetto inconsistente
Una eccezione generata da un file inesistente
Una eccezione generata da un pezzo di codice che accede al db danneggiato
Una eccezione generata da un tipo di base =0
If you were wanting to filter data, which clause would you use?
Where
Order by
From
Select
What is the correct order of clauses in a SQL statement?
SELECT, FROM, ORDER BY, WHERE
SELECT, FROM, WHERE, ORDER BY
SELECT, WHERE, FROM, ORDER BY
WHERE, FROM, SELECT, ORDER BY
Which one is not a build tool?
Maven
Ant
Git
Gradle
MAVEN needs
web.xml
manifest.yml
pom.xml
all of them
Which of the below is a source code
management tool?
Jenkins
Maven
Git
Hudson
Which one of the Source Code Management tool is distributed
Tortoise SVN
Git
BitBukcet
All of them
Git is
Open Source Project
Distributed Version Control System
secured by SHA1
All of them
git commit command use to
push changes from local repo to central repo
stage changes
push changes from staging area to local repo
all of them
Which one of them is incorrect command
git add Test.txt
git pull origin master
git push origin master
None
What is the MongoDB counterpart of SQL tables?
Document
Collection
Fluid Table
JSON Table
Documents inside MongoDB are ... ?
Schemaless
Follows rigid Schema
The different ways to handle exceptions is by using:
try & catch block and ExceptionHandler()
throws and finally()
try & catch and throws
finally() and finalize()
_________ is usually used to handle user defined exceptions
ExceptionHandler()
UserException()
throw
finalize()
100
12
10
-2
Cfare mungon ne pjesen e vijezuar?
out
line
cout
Cfare afishon kodi ne foto?
5
7
10
temp
None
I only
II only
III only
I and III only
A
B
C
D
E
A
B
C
D
E
-5
0
13
-1
12
What is the output?
x is 0
x is 1
x is 3
x is 4
What is the output?
6 3 0
3 0
3 0 -3
6 3
Dato questo snippet di codice,
public static methodName(String a, String u, String p) throws ClassNotFoundException, SQLException {
Class.forName("com.mysql.jdbc.Driver");
this.connection = DriverManager.getConnection(a,u,p);
}
Selezionare le affermazioni vere
Useremo un driver mysql all'interno della nostra applicazione
siamo in un costruttore
siamo in un metodo statico
non stiamo gestendo le eccezzioni
stiamo gestendo solo 2 tipi di eccezioni
Dato questo snippet di codice
Connection connection = DriverManager.getConnection(x,y,z,);
connection.prepareStatement(queryInsert);
cosa restituisce questa chiamata?
PreparedStatement
Statement
ResultSet
Genera una eccezione
Dato questo snippet di codice
List<String> listaStringhe = Files.readAllLines(Paths.get(path));
quale delle seguenti affermazioni è vera?
possiamo generare una IOException
possiamo generare una NullPointerException
possiamo generare una FileNotFoundException
possiamo generare una ClassCastException
Which is the biggest lake?
Lago Maggiore
Lago di Garda
Lago Trasimeno
Lago di Como
Where is Arnold Schwarzenegger from?
Germany
Canada
USA
Austria
Switzerland
Besides American, Natalie Portman is also...
Italian
Israeli
Turkish
Greek
Brazilian
Which of these are logic gates?
AND
OR
NOT
IF
ELSE
A good algorithm must be:
ambiguous
simple
open-ended
detailed
Which statement is NOT correct?
Algorithm is a computer language that a computer understands.
Algorithm has a set of instructions to follow.
One of examples of algorithms is a cooking recipe.
To tell a computer to do something, a program must be written in a computer language.
