1. Engineering
  2. Computer Science
  3. public class dishmodel private int dishiddish id private string...

Question: public class dishmodel private int dishiddish id private string...

Question details

public class DishModel {
   private int dish_id;//dish id
   private String dish_name;//dish name  
   private double dish_price;//dish price
   private String dish_description;//dish description
   private String dish_image;//dish image
  
   public DishModel(int dish_id, String dish_name, double dish_price, String dish_description, String dish_image) {
       super();
       this.dish_id = dish_id;
       this.dish_name = dish_name;
       this.dish_price = dish_price;
       this.dish_description = dish_description;
       this.dish_image = dish_image;
   }
   public DishModel(){
   }
  
   @Override
   public String toString() {
       return "Dish [ dish_name=" + dish_name + ", dish_price=" + dish_price
               + ", dish_description=" + dish_description + ", dish_image=" + dish_image + "]";
   }
   public int getDish_id() {
       return dish_id;
   }

   public void setDish_id(int dish_id) {
       this.dish_id = dish_id;
   }

   public String getDish_name() {
       return dish_name;
   }

   public void setDish_name(String dish_name) {
       this.dish_name = dish_name;
   }

   public double getDish_price() {
       return dish_price;
   }

   public void setDish_price(double dish_price) {
       this.dish_price = dish_price;
   }

   public String getDish_description() {
       return dish_description;
   }

   public void setDish_description(String dish_description) {
       this.dish_description = dish_description;
   }

   public String getDish_image() {
       return dish_image;
   }

   public void setDish_image(String dish_image) {
       this.dish_image = dish_image;
   }
  

  
}

This code is model part in MVC architecture, please explain the meaning of each piece of code.

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