As per This Post..it is said that Java does not have a nullable feature as C# has. but i have seen many methods in Android Sdk that accepts 'null' as parameters for e.g see this method
SmsManager manager = SmsManager.getDefault();
manager.sendTextMessage("address@example.com", null, "Message body here", null, null);
In the above sentTextMessage
method, it is accepting null
as parameters, i have a my method that accepts String
as parameters i also want to pass null
in some condition how can i do that ? in C# i can do public void methodName(int? param1)
but in java how to do that..here is my method that should accept null
also
public boolean update(long rowId,String status_receive,String status_send){/*xyz*/}
update(2,null,"yes") // error Invalid Argument,
My Question is how to declare a method that can accepts null values also ?