In some cases, you might need to define a function that should have a variable number of parameters; a couple of examples that you probably have encountered in Android are the printf(String format…