Application based question
What will be the output of the following method?
public static void main ()
{
into a = 5;
a++;
system.out.println(a)
a = a-- - --a;
system.out.println(a);
}
Answers
Answered by
1
you can do it like this
class Geeks {
public static void main(String[] args)
{
Geeks g = new Geeks();
g.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;
}
}
options:
a) 12 15
b) 15 15.
c) 3 4 5 3 7 5
d) 3 7 5 3 7 5
Answer: b
Similar questions