Beautiful check empty string in Java

Member

mittie.gottlieb

by mittie.gottlieb , in category: Java , 2 months ago

Beautiful check empty string in Java 😐

1
2
3
4
5
6
7
public Book(Integer id, String name, String author, BigDecimal price, Integer sales, Integer stock, String imgPath) {
   ...
   this.stock = stock;
   if (imgPath != null && !"".equals(imgPath)) {
      this.imgPath = imgPath;
   }
}
Facebook Twitter LinkedIn Telegram Whatsapp Pocket

no answers