~/ learn/ comp-348/ cards/ Parameters, returns, and what actually crosses the wire
1 of 4

Type a Serializable request object with a pinned serialVersionUID

Type a Serializable request object with a pinned serialVersionUID

Answer

public class PrimeRequest implements Serializable { private static final long serialVersionUID = 1L; private final long low; private final long high; public PrimeRequest(long low, long high) { this.low = low; this.high = high; } }

Serializable is what lets this cross the wire; the explicit serialVersionUID stops an unrelated edit on one side from breaking deserialisation on the other. Final fields make the copy semantics harmless — there is nothing to mutate and expect back.

JDK javadoc java.rmi; java.io.Serializable

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/93807e49-2b08-4113-9beb-1f0b64a32d67/flashcard utf-8 LF