I have a quick question.
What is the difference between the following:
String test = req.getParameter("Something").trim();
String test = "";
test = req.getParameter("Something").trim();
If Something is not in the querystring I get an error.
For some reason when i use the first example I get a nullpointer exception. If I use the second example it works with out a problem. I am using JRun 2.3.
The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.
Working with files is a moderately common task in Java. For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.
However, when your application has vi…
Viewers will learn about the different types of variables in Java and how to declare them.
Decide the type of variable desired:
Put the keyword corresponding to the type of variable in front of the variable name:
Use the equal sign to assign a v…