~/ 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/c45e7d9b-60d3-4222-a0d0-054076a3617b/flashcard utf-8 LF