Exception in thread "main" java.lang.Error: Unresolved compilation problems:
post cannot be resolved or is not a field
post cannot be resolved to a variable
post cannot be resolved to a variable
post cannot be resolved
这是代码:
public class HelloWorld2 {
public static void main(String[] args) {
Post.post = new Post(); // 创建博客对象
post.title = "aa的博客"; // 访问对象属性
post.content = "这是我的第一篇博客"; // 访问对象属性
post.print(); // 调用对象方法
}
}
看教程来的,都不知道是什么。。。
谢谢!
目测第一行是
Post post = new Post();
如果不是看错了的话,考虑换个教程吧