KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
The following code gives a compile error: public void method(List<String> aList) {} public void passEmptyList() { method(Collections.emptyList()); } Is there a way to pass an empty list to method without Using an intermediate variable Casting Creating another list object such as new ArrayList<String>() ?
Tags (comma-separated)
Save Edits
Cancel