What is the output of the following code: Java C# class Main { public static void
Fantastic news! We've Found the answer you've been seeking!
Question:
What is the output of the following code:
Java | C# |
class Main { public static void main(String[] args) { int[] myArray = new int[5]; try { for(int i=0;i<=5;i++) { myArray[i]=i; } System.out.println(myArray[3]); } catch(Exception e) { System.out.println("Something went wrong"); } } } | using System; class MainClass { public static void Main (string[] args) { int[] myArray = new int[5]; try { for(int i=0;i<=5;i++) { myArray[i]=i; } Console.WriteLine(myArray[3]); } catch(Exception e) { Console.WriteLine("Something went wrong"); } } } |
Related Book For
Posted Date: