Search Results

Search found 1 results on 1 pages for 'hkvega'.

Page 1/1 | 1 

  • java switch case question

    - by hkvega
    public String sizeOfSupermarket() { String size; switch (this.numberOfProducts) { case (this.numberOfProducts > 5000): size = "Large"; break; case (this.numberOfProducts > 2000 && this.numberOfProducts < 5000): size = "Medium"; break; case (this.numberOfProducts < 2000): size = "Small"; break; } return size; } the above is wrong, how to write the compare statement in case statement?

    Read the article

1