I'm new in java, what is the right way to add/pass a value into array string without specifying the array index.
I want to add a value into array like what in php array do.
static String[] var_productname = new String[20];
public void setProductName(String productName){
var_productname[] = productName;
}
staticdoesn't play well with setter methods 3) Why is a "productName" an array? Sounds like a singular object