What are the outputs of the following Java code? p...
Guiding State PSC aspirants since 2016 50,000+ students · 1,000+ final selections Exam Calendar Results Call 9116926003
pscnotes
Pick your state
APSC Prelims previous year questions

What are the outputs of the following Java code? public class array { public static void main (string args[][]) { int[] arr = {1, 2, 3, 4, 5}; system.out.println(arr[2]); system.out.println(arr[4]); } }

Asked in APSC 66 12/ Junior Manager (Electrical / Mechanical / IT/ INSTRUMENTATION) , in Assam Power Generation Corporation Limited (APGCL) (Advt. No. 12/, dtd 25-04-) ELECTRICAL ENGINEERING ME 2023

  1. 4 and 2
  2. 2 and 4
  3. 5 and 3
  4. 3 and 5
Show answer

Answer: D. 3 and 5

More APSC Prelims previous year questions questions

All 7,314 APSC Prelims previous year questions questions →