0
创建新类时遇到此类错误。以下是我的代码:令牌上的语法错误“product1”。此令牌之后预期为VariableDeclaratorId
package com.example.opener.test;
import java.util.ArrayList;
import Product.Product;
public class ProductMgrStubs {
/* Attribute */
byte[] image1 = new byte[]{6,7,5,6,5};
Product product1 = new Product("Product 1", image1, "Product 1", 0);
ArrayList<Product> productList = new ArrayList<Product>();
productList.add(product1); /* The error message popped out from here */
}
任何人都可以帮助我找出究竟发生了什么,并提出一些解决方案?我真的很感谢你的帮助
真诚
这之后我的工作把它放在一个方法里面。非常感谢你Reimeus :) – nicknguyen128 2014-11-09 02:32:59