Scratch for Java

File::loadOrCreate()

This works in a project you run on your own computer, but not in the examples you can start here in the browser. There is no file system, no video encoder and no OpenGL behind a web page, so calling it there tells you as much and does nothing.

Loads an object of the specified class from a file at the given path, or creates a new one if the file does not exist.

Syntax

Java

.loadOrCreate(path, cls)

Parameters

Name Data Type Description
path String the path to the file from which the object is to be loaded
cls Class<T> the class of the object to be loaded

Return

T

loadOrCreate()

Create Shareable URL

Select Sections