<AptiCode/>

Question 732: What will be the output of the program?class PassA { public static void main(String [] args) { PassA p = new PassA(); p.start(); } void start() { long [] a1 = {3,4,5}; long [] a2 = fix(a1); System.out.print(a1[0] + a1[1] + a1[2] + " "); System.out.println(a2[0] + a2[1] + a2[2]); } long [] fix(long [] a3) { a3[1] = 7; return a3; } }

tcs
wipro
infosys
general
aptitude
operators-and-assignments

Output: 15 15The reference variablesa1anda3refer to the same long array object. When the[1]element is updated in thefix()method, it is updating the array referred to bya1. The reference variablea2refers to the same array object.So Output: 3+7+5+" "3+7+5Output: 15 15 Because Numeric values will be added