Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Condense this? 1

Status
Not open for further replies.

KirbyWallace

Programmer
Dec 22, 2008
65
0
0
US

Code:
String[] abc = {"N",nPage.toString(),text};
vBarcodes.addElement(abc);

Is there a way to condense this into something like:

Code:
vBarcodes.addElement(String[] abc = {"N",nPage.toString(),text});

I've tried about every combination of parends that I can think of!

 
Have you tried:
Code:
vBarcodes.addElement(new String[] {"N",nPage.toString(),text});
 
So now if you have a NullPointerException on line 1 you won't know if vBarcodes or nPage was null ...

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top