在java中,类之间的关系有
(1)并列关系:
public class HelloWorld{
public static void main(String [] args ){
System.out.print("hello\tworld\n\n\n");
}
}
class hello{
public static void main(String [] args ){
System.out.print("hello\tworld\n\n\n");
}
}
class world{
public static void main(String [] args ){
System.out.print("hello\tworld\n\n\n");
}
}
(2)嵌套关系
public class Test1{
public class A{
//System.out.print("hello\tworld\n\n\n");
}
}
编译之后的结果
2019/05/27 19:16 421 hello.class
2019/05/27 19:16 426 HelloWorld.class
2019/05/27 19:15 338 HelloWorld.java
2019/05/27 19:22 287 Test1$A.class
2019/05/27 19:22 232 Test1.class
2019/05/27 19:22 92 Test1.java
2019/05/27 19:16 421 world.class