Class or Interface excepted [closed]

Class or Interface excepted [closed]



Here is the code:


public class Tuna
public void eat()
System.out.println("I am a tuna fish"); // Here it says class or interface excepted




I have a Tuna class above that has a eat method. In that eat method, it says class or interface expected at the print line. Even though it is running smoothly, when I hover over the print line in the eat method it says class or interface expected. I already checked other questions related to it but I couldn't solve it. Any help is appreciated.


eat



Image of the code



This question appears to be off-topic. The users who voted to close gave this specific reason:





If it can run you don't have any errors. Restart the IDE, it should make the error disappear.
– Guy
Sep 2 at 8:56






@Guy I restarted the IDE, but it still shows the same error.
– Hemlata
Sep 2 at 9:01





If just restarting does not help, you can also try File > Invalidate Caches / Restart > Invalidate and Restart. This usually fixes these kinds of problems.
– Leon
Sep 2 at 9:02





@Leon Thank you so much! It did made the error disappear.
– Hemlata
Sep 2 at 9:06




Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Node.js puppeteer - Use values from array in a loop to cycle through pages

How do I collapse sections of code in Visual Studio Code for Windows?