[英]Why i have array [] option as consturctor invoke?
I have a class for example GooglePlayConnection.我有一个类,例如 GooglePlayConnection。 When I create object of this class without variable initialization (just to invoke method) new GooglePlayConnection() IDEA suggest to me 2 options: like default empty constructor () and .. array []?
当我在没有变量初始化的情况下创建这个类的对象时(只是为了调用方法) new GooglePlayConnection() IDEA 向我建议了 2 个选项:比如默认的空构造函数 () 和 .. array []? What does it mean?
这是什么意思?
I don't have any constructors in these classes.我在这些类中没有任何构造函数。
You don't have to provide any constructors for your class, but you must be careful when doing this.
您不必为您的类提供任何构造函数,但在执行此操作时必须小心。 The compiler automatically provides a no-argument, default constructor for any class without constructors.
编译器自动为任何没有构造函数的类提供一个无参数的默认构造函数。
https://docs.oracle.com/javase/tutorial/java/javaOO/constructors.html https://docs.oracle.com/javase/tutorial/java/javaOO/constructors.html
...and .. array []?
...和..数组[]? What does it mean?
这是什么意思?
It's to create a GooglePlayConnection
array :这是创建一个
GooglePlayConnection
数组:
GooglePlayConnection[] connections = new GooglePlayConnection[10];
connections[0] = new GooglePlayConnection(/*...*/);
// ...
or或者
GooglePlayConnection[] connections = new GooglePlayConnection[] {
new GooglePlayConnection(/*...*/),
// ...
};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.