方法一: LocalDateTime beginTime = LocalDateTime.now(); Long opetime = Duration.between(between,LocalDateTime.now()).toMillis(); 方法二: Long beginTime = new Date().getTime(); Long opetime =new Date().getTime()-beginTime;
public class DotThis { public class Inner{ public DotThis outer(){ return DotThis.this; }; } /* 1.第一种 必须创建获取内部类的方法 public Inner inner(){ return new Inner(); }*/ public static void main(String[] args) { //DotThis dt = new DotThis(); //DotThis.Inner dt