Coding Fun Java Arrays in java interview questions and answers

Arrays in java interview questions and answers





Arrays in java interview questions and answers
1. Which of these operators is used to allocate memory to array variable in Java?
A. malloc B. alloc C. new D. new malloc

2. Which of these is an incorrect array declaration?
A. int arr[] = new int[5] B. int [] arr = new int[5] C. int arr[]
arr = new int[5]
D. int arr[] = int [5] new

3.
What will this code print?

int arr[] = new int [5];

System.out.print(arr);

A. 0 B. value stored in arr[0]. C. 00000 D. Garbage value

4. Which of these…

Tags: , , , , , , , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *