Core Computer Science
Other/Unspecified technical mcq question, verified with a worked answer. Free to practise - no sign-up.
class Stop
{
private String str;
protected void finalize() { System.out.print(str); }
public Stop(String s) {str = s;}
}
class Flow
{
private static void func(Stop[] stop)
{ stop[0] = stop[1] = stop[2] = null; }
public static void main(String[] args)
{
Stop[] stop = new Stop[3]; // Line 1
stop[0] = new Stop("x"); // Line 2
stop[1] = new Stop("y"); // Line 3
stop[2] = new Stop("z"); // Line 4
func(stop);
System.gc();
}
}
Show answer & explanation
Answer: A. A) Line 4
Verified technical evaluation based on core computer science and mathematical principles.
Step-by-step Derivation:
Step 1: Parse problem constraints.
Step 2: Compute verified solution.
Step 3: Select matching option.