1. Engineering
  2. Computer Science
  3. could anyone please explain me this or can you write...

Question: could anyone please explain me this or can you write...

Question details

Could anyone please explain me this? or can you write this other way? Thank you

public double getTotal() {

return (item1==null?0:item1.getPrice())+

(item2==null?0:item2.getPrice())+

(item3==null?0:item3.getPrice());

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution