public class Demo3 { public static void main(String[] args) { Demo3 d=new Demo3(); d.start(); } void start() { longar1[]= {3,8,2}; long ar2[]=method(ar1); System.out.print(ar1[0]+ar1[1]+ar1[2]+" "); System.out.println(ar1[0]+ar1[1]+ar1[2]+" "); } long[] method(long[] a3) { a3[3]=3; return a3; } } *
Answers
Answered by
0
JAVA PROGRAM:
CODE :
public class Demo3
{
public static void main(String[] args)
{
Demo3 d=new Demo3();
d.start();
}
void start()
{
longar1[]= {3,8,2};
long ar2[]=method(ar1);
System.out.print(ar1[0]+ar1[1]+ar1[2]+" ");
System.out.println(ar1[0]+ar1[1]+ar1[2]+" ");
}
long[] method(long[] a3)
{
a3[3]=3;
return a3;
}
}
OUTPUT:
ERROR: Compilation Failed.
#SPJ3
Similar questions