I am new to this, I have this:
public Builder id (String val)
{
id = val;
return this;
}
from below if statement i want to set builder id = 1ac. How can I do that. Thank you
if (blah blah)
{
id = "1ac";
}
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.
I think you’re looking for:
The
idmethod is written so that you pass it the value you want to set and then it returnsthisso you can chain calls together to set different values with a single statement.