I don't use the same language you use, so I might be mistaken, but it looks like you have two separate Foods.
You have one inside Snake:
public class Snake {
static int GO_UP = 1;
static int GO_DOWN = -1;
static int GO_LEFT = 2;
static int GO_RIGHT = -2;
int vector = Snake.GO_DOWN;
Food food; //<<------
And you have one inside GameScreen:
public class GameScreen extends JPanel implements Runnable{
private static final long serialVersionUID = 1L;
static int weightpanel = 650;
static int heightpanel = 650;
Controller controller;
MapNoWall map;
Snake snake;
Thread thread;
Food food; //<<-----
The one inside GameScreen is the one you are drawing. The one inside Snake is the one you are erasing. These are two separate copies (called "instances") of the Food class, and if you change one, it's not going to change the other, they are two different copies / instances.
Snake should not own the food - what you need to do is somehow give Snake temporary access to GameScreen's 'food' variable only during the 'Snake.update()' function, by passing GameScreen's food into the Snake.update() as a parameter. However! It has to be passed by reference (temporarily sharing a single instance), not passed by value (copying the instance is not what you want), and since I don't know your language, I can't tell you exactly how to do that - perhaps someone else knows, or you can google "<your language name> pass by reference" and learn about it. It's possible your language passes function parameters by reference by default.