0

This is my first time using IntelliJ and I am learning to code Java. When I am pressing the button "run", my program does not print "I love pizza!" instead it prints "Hello World!". Why is this and how can I fix it?

I have tried to run my code multiple times and I have added "application" as run configurations.

enter image description here

5
  • 1
    Please post code, not a picture of code. No-one can run a picture. Commented Nov 9, 2022 at 17:44
  • 1
    What do you mean? Should I copy paste my code as a comment here? Commented Nov 9, 2022 at 17:48
  • 1
    You should edit your question. Most probably you are either running different main method or running the old code. Commented Nov 9, 2022 at 17:51
  • 1
    Please post text, not images. Commented Nov 9, 2022 at 17:52
  • Thanks, I will edit my question. The follow up question becomes how do I check my main method so that the correct code is running? Commented Nov 9, 2022 at 18:03

1 Answer 1

2

Try creating a new class in the /src directory The hierachy would then be /YourProjectName/src/yourJavaClass

kind regards!

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.