~/ 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/cef28fbb-3408-4b33-9c23-fd25d8247d79/flashcard utf-8 LF