You pass the parameter just like you'd pass any other parameter.
That is, if you have a variable such as List<List<String>> myMultidimensionalStringList, your method call would be
Util.hasPreference(myMultidimensionalStringList);
I don't think that's what you're actually asking about though. If I had to take a guess, I'd guess that your actual question is how to get data into such a variable in the first place.
There are a few different ways you could approach this, which I'll illustrate below.
// The thing to realize in all of these examples is that the outermost level
// is a List of Lists.
// This is a bit different from the multidimensional arrays in C++, for example.
// Instead of simply adding values directly to the List<List<String>> at your target
// indices, you'll need to store your values in lists, and then add those lists
// to your List<List>.
// First, using curly braces to initialize a list directly.
// I wouldn't recommend doing this directly in a method call
myMultidimensionalStringList = new List<List<String>>{
new List<String>{'a', 'b', 'c'},
new List<String>{'1', '2', '3'},
new List<String>{'foo', 'bar', 'baz'}
};
// Second, adding empty lists to the outermost list, and then adding values
myMultidimensionalStringList = new List<List<String>>();
// You can use the curly brace initialization here too
myMultidimensionalStringList.add(new List<String>{'a', 'b', 'c'});
// ...or add a completely empty list and populate values as you go
myMultidimensionalStringList.add(new List<String>());
myMultidimensionalStringList[1].add('1');
myMultidimensionalStringList[1].add('2');
myMultidimensionalStringList[1].add('3');
// Third, using loops, which cuts down on the amount of code you have to write
List<String> tempList;
for(MyObject__c myObj :[<some query here>]){
tempList = new List<String>();
tempList.add(myObj.someField__c);
tempList.add(myObj.someOtherField__c);
myMultidimensionalStringList.add(tempList);
}
List<List<String>>, please edit your question to reflect that. If that isn't it, some additional explanation of what exactly you're stuck on would be helpful.