It depends where you eat. Outlets in food Courts in malls (like the Mall of Berlin) accept credit cards and so do some smaller restaurants. Even Germany is not that focused on cash anymore. Contrary, if you visit a food stall on a market or prefer the Döner, Currywurst from the smaller shops, you need cash. It depends, where he will be. If you buy something from the groceries stores e.g. Rewe, Edeka, HIT (like packed sandwiches or beverages) you can pay with card
McDonald's, Burger King, Subways, Starbuclks usually accepts credit card (and apple pay)