What does `ObjectMapper mapper = []` mean in groovy?
问题 I'm new to groovy, and I'm reading the source of a project gretty import org.codehaus.jackson.map.ObjectMapper class JacksonCategory { static final ObjectMapper mapper = [] ... } I don't understand the code ObjectMapper mapper = [] , what does [] mean here? I thought it's a list , but how to assign it to a ObjectMapper ? UPDATE Depends on Dunes's answer, seems [] means invocation of default constructor . So, it means: static final ObjectMapper mapper = new ObjectMapper() But: String s = []