public string isValidUser(string name, string password) // a function to check if admin exists { for (int i = 0; i < allUsers.Count; i++) { MailUser user = (MailUser)allUsers[i]; if (user.getPin() == password && user.getName() == name) { return("admin"); //only if admin exists } } //if its not admin,check if its a user users_manager check = users_manager.get_instance; //creating object of another class string a = check.isValidUser(name, password); //calling a function of class (line99) return(a); //returning string }