wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Java Code italian - settimana 4 corso DSTECH

Total questions: 90

Worksheet time: 2hrs 22mins

Name
Class
Date
1.

Quali delle seguenti affermazioni relative alle interfacce java è vera?

a)

una interfaccia può definire campi non statici

b)

i metodi di un'interfaccia hanno visibilità di accesso package

c)

i campi di una interfaccia sono final

d)

una interfaccia può estendere una classe astratta

2.

Nel linguaggio Java, a cosa servono i costruttori?

a)

Definire un metodo di un oggetto

b)

Definire il codice per l'implementazione delle interfacce

c)

definire le istruzioni da eseguire quando si istanzia un oggetto

d)

È un metodo particolare per invocare il super()

3.

cos'è il bytecode

a)

La quantità di memoria allocata dinamicamente

b)

La quantità di memoria allocata staticamente per le code di stampa

c)

Il contenuto di un file di estensione class

d)

il codice ASCII o UNICODE dei singoli Byte

4.

Una classe è...

a)

L'istanza di un oggetto

b)

L'insieme delle dichiarazioni degli oggetti

c)

Un modello astratto per una famiglia di oggetti con caratteristiche simili

d)

Il nome che rappresenta un oggetto

e)

Un programma contenente il metodo main()

5.

Un oggetto è

a)

colui che manda un messaggio

b)

una istanza di una classe

c)

un insieme di caratteristiche simili

d)

una classe non astratta

e)

un programma che rappresenta una classe

6.

Un array monodimensionale (o vettore) è...

a)

un insieme di valori ordinati

b)

un insieme di dati dello stesso tipo

c)

un insieme di dati individuabili tramite indice

d)

una serie di valori vuoti

e)

una serie ordinata di interi

7.

Which data type gets returned from length() method in String class?

a)

double

b)

String

c)

int

d)

number

8.

Class Cat extends Animal. Which is NOT a valid declaration?

a)

Cat x = new Cat();

b)

Animal X = new Animal();

c)

Cat x = new Animal();

d)

Animal x = new Cat();

9.

Which statement below is the correct way to retrieve the first element in the nums ArrayList?

a)

nums.get(0)

b)

nums[0]

c)

nums(0)

d)

nums[1]

10.

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));

a)

7

b)

8

c)

9

d)

0

11.
What happens if a variable or method is made private?
a)
It can be accessed by any class inherited from the current class
b)
It can be accessed from another object unrelated to the current one.
c)
It cannot be accessed by an unrelated object from the outside.
d)
It cannot be accessed by anything
12.

2

a)

5

b)

7

c)

9

d)

13

e)

20

13.
Which is the correct way to declare an ArrayList of Strings in Java?
a)
ArrayList<String>
b)
ArrayList(String)
c)
ArrayList[String]
d)
ArrayList{String}
14.

IronMan or Thor?

a)
b)
15.
An object created from a class in a java program is known as an object...
a)
method
b)
instance
c)
parameter
16.

What is output by the code? Pretend it says System.out.println

a)

2

b)

3

c)

4

d)

5

e)

6

17.
a)

123

b)

12

c)

1234

d)

12345

e)

4321

18.

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?

a)

20 20

b)

20.0 30

c)

20.7 31

d)

20.7 30.7

e)

Nothing will be printed because of a compile-time error.

19.

The variable "trash" will store what value?

a)

2

b)

10

c)

1

d)

3

20.

What will the code print?

a)

Jimmy

b)

Timmy

c)

Potatoes

d)

A blank line

21.

What value is printed to the console?

a)

true

b)

W

c)

false

d)

L

22.

What value is printed to the console?

a)

This restaurant is not my favourite.

b)

This restaurant is good.

c)

This restaurant is fantastic!

d)

I've never dined at this restaurant.

e)

3

23.
Given the following method, what would test return if
a = {0, 2, 3, 4} and v = 2?
a)
0
b)
1
c)
2
d)
-1
24.

Cosa definisco quando implemento l'interfaccia comparable

a)

un ordinamento al momento

b)

un ordinamento naturale

c)

la possibilità di salvare su file

d)

la possibilità di usare una lista

25.

L'interfaccia ________ serve a darci la possibilità di salvare su stream oggetti da noi costruiti

a)

Comparable

b)

Saverizable

c)

Serializable

d)

Corruptable

26.

Cosa è una NullPointerException

a)

Una eccezione generata da un oggetto inconsistente

b)

Una eccezione generata da un file inesistente

c)

Una eccezione generata da un pezzo di codice che accede al db danneggiato

d)

Una eccezione generata da un tipo di base =0

27.
MySQL is
a)
A Programming language
b)
A technique for writing reliable programs
c)
 A Relational Database Management System
d)
None of the Above
28.
What does "Select" command do at MySQL database? 
a)
Write.
b)
Read.
c)
Delete.
d)
Update.
29.

If you were wanting to filter data, which clause would you use?

a)

Where

b)

Order by

c)

From

d)

Select

30.

What is the correct order of clauses in a SQL statement?

a)

SELECT, FROM, ORDER BY, WHERE

b)

SELECT, FROM, WHERE, ORDER BY

c)

SELECT, WHERE, FROM, ORDER BY

d)

WHERE, FROM, SELECT, ORDER BY

31.
What should a primary key contain?
a)
A lot of different values
b)
A null value
c)
An unique value
32.

Which one is not a build tool?

a)

Maven

b)

Ant

c)

Git

d)

Gradle

33.

MAVEN needs

a)

web.xml

b)

manifest.yml

c)

pom.xml

d)

all of them

34.

Which of the below is a source code

management tool?

a)

Jenkins

b)

Maven

c)

Git

d)

Hudson

35.

Which one of the Source Code Management tool is distributed

a)

Tortoise SVN

b)

Git

c)

BitBukcet

d)

All of them

36.

Git is

a)

Open Source Project

b)

Distributed Version Control System

c)

secured by SHA1

d)

All of them

37.

git commit command use to

a)

push changes from local repo to central repo

b)

stage changes

c)

push changes from staging area to local repo

d)

all of them

38.

Which one of them is incorrect command

a)

git add Test.txt

b)

git pull origin master

c)

git push origin master

d)

None

39.
What does "Insert into" command do at MySQL? 
a)
Delete.
b)
Database.
c)
MySQL.
d)
Write
40.
What is database?
a)
Collection of organized data that allows access, retrieval of  that data.
b)
Collection of organized data that allows access, retrieval, and use of  that data.
c)
Collection of organized data that allows retrieval, and use of  that data.
41.
Which of the following is the most important feature of DBMS:
a)
Command language like SQL
b)
Ability to back up data
c)
Ease of use
d)
Ability to automate some tasks
42.
A database entity is also known as:
a)
a table
b)
a field
c)
a row
d)
a report
43.
A particular DBMS uses SQL for extracting data. The SQL command "WHERE" is usually followed by:
a)
a criteria
b)
a table name
c)
a user name
d)
a mathematical formula
44.
Does GitHub have a set programming language?
a)
Yes
b)
No
45.
GitHub is a VCS. A VCS is a...
a)
Version Control System
b)
Visual Control System
c)
Version Constraint System
d)
Version Control Software
46.
git push
a)
Places the changes to the repository
b)
Takes the changes from the repository
c)
Is not a command
47.
git pull
a)
Places the changes to the repository
b)
Takes the changes from the repository
c)
Is not a command
48.
A local repository is..
a)
On your computer
b)
Online
49.
A remote repository is..
a)
On your computer
b)
Online
50.

What is the MongoDB counterpart of SQL tables?

a)

Document

b)

Collection

c)

Fluid Table

d)

JSON Table

51.

Documents inside MongoDB are ... ?

a)

Schemaless

b)

Follows rigid Schema

52.

The different ways to handle exceptions is by using:

a)

try & catch block and ExceptionHandler()

b)

throws and finally()

c)

try & catch and throws

d)

finally() and finalize()

53.

_________ is usually used to handle user defined exceptions

a)

ExceptionHandler()

b)

UserException()

c)

throw

d)

finalize()

54.
a)

100

b)

12

c)

10

d)

-2

55.

Cfare mungon ne pjesen e vijezuar?

a)

out

b)

print

c)

line

d)

cout

56.

Cfare afishon kodi ne foto?

a)

5

b)

7

c)

10

d)

temp

57.
How can we get the number of records or rows in a table?
a)
 Using COUNT
b)
Using NUM
c)
 Using NUMBER
d)
Both a and c above
58.
Which is the default order of sort in ORDER BY clause?
a)
Ascending
b)
Descending
59.
a)

None

b)

I only

c)

II only

d)

III only

e)

I and III only

60.
a)

A

b)

B

c)

C

d)

D

e)

E

61.
a)

A

b)

B

c)

C

d)

D

e)

E

62.
a)

-5

b)

0

c)

13

d)

-1

e)

12

63.
The ____ method executes first in an application, regardless of where you physically place it within its class.
a)
execute()
b)
main()
c)
start()
d)
run()
64.

What is the output?

a)

x is 0

b)

x is 1

c)

x is 3

d)

x is 4

65.

What is the output?

a)

6 3 0

b)

3 0

c)

3 0 -3

d)

6 3

66.

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

a)

Useremo un driver mysql all'interno della nostra applicazione

b)

siamo in un costruttore

c)

siamo in un metodo statico

d)

non stiamo gestendo le eccezzioni

e)

stiamo gestendo solo 2 tipi di eccezioni

67.

Dato questo snippet di codice


Connection connection = DriverManager.getConnection(x,y,z,);

connection.prepareStatement(queryInsert);


cosa restituisce questa chiamata?

a)

PreparedStatement

b)

Statement

c)

ResultSet

d)

Genera una eccezione

68.

Dato questo snippet di codice


List<String> listaStringhe = Files.readAllLines(Paths.get(path));


quale delle seguenti affermazioni è vera?

a)

possiamo generare una IOException

b)

possiamo generare una NullPointerException

c)

possiamo generare una FileNotFoundException

d)

possiamo generare una ClassCastException

69.
Who is Marios real GF?
a)
Princess Peach
b)
Princess Daisy
c)
Rosalina
70.
Who did Matthew Perry play on "Friends"?
a)
Ross 
b)
Joey
c)
Chandler
d)
Gunther
71.
Who is the author of the book 1984?
a)
Thomas Hardy
b)
Emilie Zola
c)
George Orwell
d)
Walter Scott
72.

Which is the biggest lake?

a)

Lago Maggiore

b)

Lago di Garda

c)

Lago Trasimeno

d)

Lago di Como

73.

Where is Arnold Schwarzenegger from?

a)

Germany

b)

Canada

c)

USA

d)

Austria

e)

Switzerland

74.

Besides American, Natalie Portman is also...

a)

Italian

b)

Israeli

c)

Turkish

d)

Greek

e)

Brazilian

75.
Songs: Wish you Where Here, Hey You, Another Brick in the Wall
a)
Twisted Sister
b)
Pink Floyd
c)
Whitesnake
d)
The Police
76.
Who was the lead singer of the band "Queen"?
a)
George Michael
b)
Freddie Mercury
c)
Simon Le Bon
d)
David Bowie
77.
What musician won the Nobel Prize for Literature in 2016?
a)
Adele
b)
Ed Sheeran
c)
Phil Collins
d)
Bob Dylan
78.
What was the highest selling album of the 1980's?
a)
"The Dark Side of the Moon" (Pink Floyd)
b)
"The Bodyguard" (Whitney Houston)
c)
"21" (Adele)
d)
"Thriller" (Michael Jackson)
79.
What famous US festival hosted over 350,000 fans in 1969?
a)
Coachella
b)
Tomorrowland
c)
Rock in Rio
d)
Woodstock
80.
Jimmy Page is an English musician who formed which rock band in 1968?
a)
Led Zeppelin
b)
AC/DC
c)
Bee Gees
d)
Metallica
81.
What Pink Floyd song was banned by the South African government after it became an anthem for black school children?
a)
Wish You Were Here
b)
Learning to Fly
c)
Another Brick in the Wall
d)
Hey You
82.
Who wrote the song "Stairway to Heaven" from Led Zeppelin? 
a)
Jimmy Page and Robert Plant
b)
John Bonham and Paul Jones
c)
Mike Love and Al Jardine
83.
Who is NOT a member of "The 27 Club"?
a)
Jimi Hendrix
b)
Jim Morrison
c)
Amy Winehouse
d)
Freddie Mercury
84.
What is the first rule that is made in the movie Fight Club
a)
Don't talk about the club.
b)
No head shots.
c)
No biting ears.
d)
No kicking.
85.
On what day is Pi Day celebrated?
a)
January 1
b)
March 14
c)
March 13
d)
February 13
86.
Solve the proportion below. 
a)
Z=21
b)
Z=7
c)
Z=8
d)
Z=24
87.

Which of these are logic gates?

a)

AND

b)

OR

c)

NOT

d)

IF

e)

ELSE

88.
An Algorithm has 4 main characteristics. It should be....
a)
Doable, Creative, finite and precise
b)
Doable, Understandable, finite and precise
c)
Amazing, Understandable, finite and precise
d)
Doable, Understandable, Infinite and precise
89.

A good algorithm must be:

a)

ambiguous

b)

simple

c)

open-ended

d)

detailed

90.

Which statement is NOT correct?

a)

Algorithm is a computer language that a computer understands.

b)

Algorithm has a set of instructions to follow.

c)

One of examples of algorithms is a cooking recipe.

d)

To tell a computer to do something, a program must be written in a computer language.