eclipse调试的一些技巧

如果当前的调试的位置是一个方法而这个方法的参数也是一个方法
那么先进入的话会先进入参数的方法,然后返回在进入方法才能进入这个方法本身。

例子

public class Player{
	private int id;
	public void setId(int id){
	this.id=id;
	}
	public int getId(){
	return id;
	}
}
public class Server(){
	public void testMethod(int id){
		System.out.println("测试id为"+id);
	}
}
public class Test(){
	public static void main(String[] args){
		Player player=new Player();
		Server server=new Server();
		server.testMethod(player.getId());
//如果调试到这 会先进到getId()方法 我们想去testMethod()就要先进去在退出在进去就到了 testMethod()方法,这里只是举了一个很简单的例子;
		
	}
}

猜你喜欢

转载自blog.csdn.net/hj1997a/article/details/84068302