I have a requirement, to assign the values in array structure , collections are to be avoided,
testFunction(String userName,String Password,String status)
{
String[] array;
if(password==null)
{
array={"username",username_variable,"status",status_variable}
}
else
{
array={"username",userName,"password",password,"status",status}
}
}
In java as arrays are objects, so you have to create an object to initialize the elements of the array.
convert
to