Computer Science, asked by safrinists, 1 month ago

Determine the output

public class Trial

{

public static void main(String[] args)

                {

                                int arr[4]={};

                                System.out.print(arr[0]);

                }

}


Select one:

0

Garbage error

Runtime error

Compile time error​

Answers

Answered by ubada5531
0

Answer:

// file name: Main.java

public class Main {

   public static void main(String args[]) {

      int arr[] = {10, 20, 30, 40, 50};

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

      {

            System.out.print(" " + arr[i]);              

      }

   }

}

Answered by shelbyjones21
1

Answer:

Compile time error

Explanation:

int arr[4] is syntactically wrong

Similar questions