How to pass null to method that expects long or int?
java
Solution
The problem is that `int` and `long` are primitives. You can't pass `null` to a primitive value.
You can certainly use the wrapper classes `Integer` and `Long` instead of `long` and `int` in your method signature.
Problem
Could be dumb question, but how can I pass `null` to method which takes `long` or `int`? Example: ``` TestClass{ public void iTakeLong(long id); public void iTakeInt(int id); } ``` now how can i pass null to both methos: ``` TestClass testClass = new TestClass(); testClass.iTakeLong(null); // Compilation error : expected long, got null testClass.iTakeInt(null); // Compilation error : expected int, got null ``` Thoughts, suggestions?