I want to declare all of them null. Am I doing someting wrong or is this the right method?
String a = null, b = null, c = null, d = null;
(Is there any more compact syntax for doing this?)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yep. That’s the way to do it.
You could also do
The line below however won’t compile:
(Note that if these are member variables, they will be initialized to
nullautomatically.)