[英]In Eclipse, what is 'Enclosing type" when creating a class?
You can add anested class using Enclosing type
option您可以使用
Enclosing type
选项添加嵌套类
For example Class com.A, Add it as Enclosing type of new Class B例如 com.A 类,将其添加为新 B 类的封闭类型
It will create a nested class B它将创建一个嵌套的类 B
public class A {
private static class B {
}
}
See more in Eclipse Help在Eclipse 帮助中查看更多信息
Enclosing type Select this option to choose a type in which to enclose the new class.
封闭类型 选择此选项可选择将新类封闭在其中的类型。
So in this case where java file is created inside the existing java file .like
where we selected the Test1 as Enclosing type and Test2 is the new java class file.
public class Test1 {
public class Test2 {
}
public static void main(String[] args) {
System.out.println("simple its the part of the class Test1");
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.