wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Test valutazione 2,5 settimana

Total questions: 28

Worksheet time: 57mins

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.
We are use For loop ..........
a)
To repeat a specified number of operations.
b)
To repeat a unspecified number of operations.
c)
All answers are correct
8.
When we want to print in Java, we use the code ......
a)
system.out.print();
b)
System.out.println();
c)
System.Out.Printf();
d)
System.out.show();
9.

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

a)

double

b)

String

c)

int

d)

number

10.

What will be the output of below code?


String statement = "Outfit of the day";

System.out.println(statement.Substring(3,6));

a)

it of

b)

tfit

c)

fit

d)

FIT

11.

The following Syntax is used for?


class Subclass-name extends Superclass-name

{

//methods and fields

}

a)

Polymorphism

b)

Encapsulation

c)

Inheritance

d)

None of the above

12.

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

13.

What index value is used to locate the last element in the nums ArrayList?

a)

nums.size()-1

b)

nums.length()-1

c)

nums.size()

d)

nums.length

14.

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]

15.

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

16.

What is the keyword "final" used for in Java?

a)

identify a constant

b)

identify an integer

c)

identify a string

d)

Identify a final answer

17.
These controls the behavior of a program.
a)
class
b)
object
c)
method
d)
void
18.
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
19.
What keyword is used to allow one class to inherit from another?
a)
extend
b)
extends
c)
extension
d)
exterminate
20.
Java is highly portable because 
a)
it creates a single executable file that works on all computers.
b)
it creates a single byte code file that is interpreted at the user's computer.
c)
everyone uses it.
d)
it says so in the text book.
21.

2

a)

5

b)

7

c)

9

d)

13

e)

20

22.
a)

-1 0 2 5

b)

-1 0 3 7

c)

-1 1 4 8

d)

0 2 5 9

e)

0 1 3 7

23.

Java method (function/module) definitions can contain which of the following parts in their headers?

a)

An access modifier such as public or private

b)

An optional access specifier called static

c)

a return type or void

d)

all of the above

24.
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}
25.

IronMan or Thor?

a)
b)
26.
_______ is how we write code
a)
Syntax
b)
Loops
c)
Variables
d)
Functions
27.
In the code example: hero.moveRight(), what is the object?
a)
move
b)
hero
c)
()
d)
Right
28.
what does CPU stand for??
a)
Central Processing unit
b)
Control Processing unit