你能帮我解决下面的代码吗?错误是:"无法在静态上下文中使用它"
public class Sample2 {
/**
* @param args
*/
public static void main(String[] args)
{
Sample2 sam=new Sample2();
//Below code works fine
System.out.println(sam);
//Below code is displaying error
System.out.println(this);
}
}
Run Code Online (Sandbox Code Playgroud) 我在代码库CVS中的代码.我已将代码下载到我的eclipse中.当我在eclipse中提交更改时,在我编写CVS更新命令之前,它不会影响CVS中的代码.我认为在CVSROOT/loginfo中需要将一些代码添加到此文件中.你能帮忙吗?