Programming Paradigms
Java
Arrays
10

database programming methodology is based on data and its movement.  

True

10

The Java compiler translates Java source code into a special representation called 

bytecode

10

Which line is correct? 

1. ArrayList(Integer) list = new ArrayList(); 

2. ArrayList[Integer] list = new ArrayList[](); 

3. ArrayList<Integer> list = new ArrayList<>(); 

4. ArrayList<int> list = new ArrayList<>();

3. ArrayList<Integer> list = new ArrayList<>();

20

In computer science the imperative programming is a style of building programs that expresses logic of computation without talking about its control flow.

In computer science the declarative programming is a style of building programs that expresses logic of computation without talking about its control flow. 

20

Another software tool, called an  ______________

translates bytecode into machine language 

and executes it 

 interpreter 


20

public static void modifyArray( int[] array2 )

{

for ( int counter = 0; counter < array2.length; counter++ )

array2[ counter ] *= 2;

multiply each element of an array by 2

30

This is the only difference between imperative (what to do) and declarative (how to do) programming paradigms

This is the only difference between imperative (how to do) and declarative (what to do) programming paradigms

30

Every class in java is a part of _____________

 some package

30

 Find and correct the error in each of the following program segment:

Assume int[] b = new int[ 10 ];

for ( int i = 0; i <= b.length; i++ )

b[ i ] = 1;

Error: Referencing an array element outside the bounds of the array (b[10]).

Correction: Change the <= operator to <.

M
e
n
u