它不应该那么难.我的意思是在C,
int a[10];
Run Code Online (Sandbox Code Playgroud)
是你所需要的全部.如何为随机大小创建全零的数组.我知道NumPy中的零()函数,但必须有一个简单的内置方法,而不是另一个模块.
我来自Java,我想做一些像这样的数据传输对象(DTO):
class ErrorDefinition():
code = ''
message = ''
exception = ''
class ResponseDTO():
sucess = True
errors = list() # How do I say it that it is directly of the ErrorDefinition() type, to not import it every time that I'm going to append an error definition?
Run Code Online (Sandbox Code Playgroud)
或者有更好的方法吗?