VS code - Incorrect package

Zaberz 0 Reputation points
2024-12-16T13:35:39.7766667+00:00

I'm a computer science student and I'm learning java for school. I'm using vs code but currently I'm encountering a problem that keeps me from compiling my code. When I want to declare a package vs code says it is an incorrect package even though it isn't. With other projects I had the same and sometimes not using the package line works but in this case it doesn't how can I fix this?
I have included 2 images, the first one is where it works without declaring the package for some reason the second one is where it does not work even though I use the correct package. User's image

User's image

Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other
A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 31,156 Reputation points Microsoft External Staff
    2024-12-17T01:57:22.2433333+00:00

    Hi @Zaberz

    Welcome to Microsoft Q&A!

    The tag “Visual Studio” is related to Visual Studio, for more questions about Visual Studio Code, we suggest you post it to the GitHub-vscode forum where you would get support for this product. Thanks for your understanding. 

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".  Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.