Examveda

Which of these is an incorrect array declaration?

A. int arr[] = new int[5]

B. int [] arr = new int[5]

C. int arr[] = new int arr[5]

D. int arr[] = int [5] new

Answer: Option D


This Question Belongs to Java Program >> Array

Join The Discussion

Comments (1)

  1. Piyush Jain
    Piyush Jain:
    1 year ago

    C is also wrong.
    error: '[' expected int arr[] = new int index[5];
    error: ']' expected int arr[] = new int index[5];

Related Questions on Array