I have the following code snippet where some strings are initialized in the if
block:
String serialmask = request.getParameter( "serialmask");
String serialincrement = request.getParameter( "serialincrement");
if (serialmask == "1") {
String tserialmask = "aaa########";
}
else {
String tserialmask = "";
}
if (serialincrement == "1") {
String tserialincrement = "aaa^^^^^^^^";
}
else {
String tserialincrement = "";
}
out.println(
itemimport(
partnumber,
itemcost,
itemlistprice,
itemdescription,
PurchProdLineKey,
UnitMeasKey,
itemclasskey,
trackmethod,
tserialmask,
tserialincrement
)
);
The error I'm getting is "cannot find symbol"
symbol : variable tserialmask
in the out.println(itemimport(....tserialmask,tserialincrement));
statement.
I tried declaring the variables outside of the if
block and this seems to bring on even more errors saying it's already been declared.