标签:static todo getname org com play package this str
package com.gxnu.edu.lqm.collection;
public class NestEx {
private String name;
public class Nest{
public void Nest(String str){
System.out.println(str);
}
}
public static class StaticNest{
public void play(){
System.out.println("play");
}
}
public NestEx() {
super();
// TODO Auto-generated constructor stub
}
public NestEx(String name) {
super();
this.name = name;
}
@Override
public String toString() {
return "NestEx [name=" + name + "]";
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
package com.gxnu.edu.lqm.collection.test;
import org.junit.Test;
import com.gxnu.edu.lqm.collection.NestEx;
import com.gxnu.edu.lqm.collection.NestEx.Nest;
import com.gxnu.edu.lqm.collection.NestEx.StaticNest;
public class NestTest {
@Test
public void testNest(){
NestEx nestEx = new NestEx();
NestEx.Nest nest = nestEx.new Nest();
nest.Nest("xxioa");
NestEx.StaticNest staticNest = new NestEx.StaticNest();
staticNest.play();
}
@Test
public void testNest1(){
NestEx nestEx = new NestEx();
Nest nest = nestEx.new Nest();
nest.Nest("xxioa");
StaticNest staticNest = new NestEx.StaticNest();
staticNest.play();
}
}
标签:static todo getname org com play package this str
原文地址:https://www.cnblogs.com/jiminluo/p/9337844.html