Question: (java) hello! as you see i have the answer to this, but still having problem undrestanding it. the . after p, to me seems like

(java)
hello!
as you see i have the answer to this, but still having problem undrestanding it.
the "." after p, to me seems like p is calling intArray method. but it shouldnt be the case because instead of () there is a [], would you please clarify?  (java) hello! as you see i have the answer to this,

12. Please write the output for the following program. public class TestJavaMain { final int[] p = (4,5,6); // intArray public static void main(String[] args) { System.out.printin(p.intArray (op -+ p.intArray(1)+" + P.intArray[2]); ) (a) it has a compile error. (b) it displays "456" (c) it displays "156". (d) it throws an exception. Answer: c. (the final variable of object cannot change its reference to another object, but you still can modify the value of the object.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!