fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.io.*;
  4.  
  5. /* Name of the class has to be "Main" only if the class is public. */
  6. class Ideone
  7. {
  8. public static void main (String[] args)
  9.  
  10. {
  11. String to = "azg";
  12. String cc = "abc@cba.com.au";
  13. if(to == null || to.isEmpty())
  14. {
  15. to = cc;
  16. cc = null;
  17. System.out.println("to is empty");
  18.  
  19. }
  20. else if(cc == null || cc.isEmpty()){
  21. cc = null;
  22. System.out.println("cc is empty");
  23. }
  24.  
  25. else if( (to != null && !(to.isEmpty())) & (cc != null && !(cc.isEmpty())) )
  26. {
  27.  
  28. // template.setTo(to);
  29. //check to send email in cc only if user as LM and LM is Active
  30. // template.setCc(cc);
  31. System.out.println("nothig is empty");
  32. }
  33. else
  34. {
  35. System.out.println("Both are empty");
  36.  
  37. }
  38.  
  39.  
  40. }
  41. }
Success #stdin #stdout 0.08s 54632KB
stdin
stdout
nothig is empty