How to check whether a int is not null or empty?

Int variables can't be null If a null is to be converted to int, then it is the converter which decides whether to set 0, throw exception, or set another value (like Integer. MIN_VALUE). Try to plug your own converter.

If your int variable is declared as a class level variable (instance variable) it would be defaulted to 0. But that does not indicate if the value sent from the client was 0 or a null. May be you could have a setter method which could be called to initialize/set the value sent by the client.

Then you can define your indicator value , may be a some negative value to indicate the null..

Actually int can't be null. May be you could check for null, if value is not null, then transform String representation to int.

I think you are asking about code like this. Int count = (request. GetParameter("counter") == null)?0 : Integer.

ParseInt(request. GetParameter("counter")).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions