Scratch for Java

SaveData::loadOrDefault()

Returns defaults only when the file is missing. Unreadable, incompatible, empty or corrupt files raise IOException and remain untouched. Defaults stay in memory until the game explicitly calls save.

Examples

View on GitHub

Syntax

Java

.loadOrDefault(defaults)

Parameters

Name Data Type Description
defaults Supplier<? extends T> creates initial progress for a missing slot; called only when missing

Return

T

loadOrDefault()

Create Shareable URL

Select Sections