} 
                  
                  
                  
                  
                  
                  But be aware of the case that one of your string objects could be null...
                  
                  
                  
                  
                  
                  
                  
                  
                  if((str1 != null ? str1.length() : 0) >= (str2 != null ? str2.length() : 0)) { ... }
                  
                  
                  
                  
                  
                  
                  
                  
                  for example...
                  
                  
                
not length. Actually both of them are integers. I need to check if any of them are greater or equal. These are values from 2 json files the version numbers. When given Integer instead of string, error occurs. That is the reason I went with String.
Обсуждают сегодня