Q:

Android:String concatenation in Toast doesn't work

I've designed an app, part of which requires me to display a toast based on how many input fields are left empty.
Here's my code snippet-
if ((isEmpty(firstName))||(isEmpty(lastName))||(isEmpty(Age))||(isEmpty(phoneNumber)))
{
    String text="Following fields are empty:";
    if ((isEmpty(firstName))||(isEmpty(lastName))){
        text.concat("\nName");
    }
    if ((isEmpty(Age))){
        text.concat("\nAge");
    }
    if ((isEmpty(phoneNumber))){
        text.concat("\nPhone Number");
    }
    Toast toast=Toast.makeText(this, text, Toast.LENGTH_SHORT);
    toast.show();
}

Here isEmpty() returns True if the input field is empty, else it returns false.
Now, I expected the output (when all fields are empty), to show
Following fields are empty:
 Name
 Age
 Phone Number
However, it only shows Following fields are empty: .
Where's my mistake?
RESOLVED- Instead of concat(), I used text+="name" and so on.
But why didn't concat() work?

A:

if ((isEmpty(firstName))||(isEmpty(lastName))||(isEmpty(Age))||(isEmpty(phoneNumber)))
{
    String text="Following fields are empty:";
            if ((isEmpty(firstName))||(isEmpty(lastName))){
                text = text.concat("\nName");
            }
            if ((isEmpty(Age))){
                text = text.concat("\nAge");
            }
            if ((isEmpty(phoneNumber))){
                text = text.concat("\nPhone Number");
            }
            Toast toast=Toast.makeText(this, text, Toast.LENGTH_SHORT);
            toast.show();
        }

A:

Change text.concat("\nName");
to 
text = text.concat("\nName");

And same for age and Phone Number
i.e. simply use
if ((isEmpty(firstName))||(isEmpty(lastName))||(isEmpty(Age))||(isEmpty(phoneNumber)))
{
    String text="Following fields are empty:";
            if ((isEmpty(firstName))||(isEmpty(lastName))){
                text = text.concat("\nName");
            }
            if ((isEmpty(Age))){
                text = text.concat("\nAge");
            }
            if ((isEmpty(phoneNumber))){
                text = text.concat("\nPhone Number");
            }
            Toast toast=Toast.makeText(this, text, Toast.LENGTH_SHORT);
            toast.show();
        }

Or Simply use as 
if ((isEmpty(firstName))||(isEmpty(lastName))||(isEmpty(Age))||(isEmpty(phoneNumber)))
    {
        String text="Following fields are empty:";
                if ((isEmpty(firstName))||(isEmpty(lastName))){
                    text +="\nName";
                }
                if ((isEmpty(Age))){
                    text +="\nAge";
                }
                if ((isEmpty(phoneNumber))){
                    text +="\nPhone Number";
                }
                Toast toast=Toast.makeText(this, text, Toast.LENGTH_SHORT);
                toast.show();
            }

