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

Dave Newton
  • 158,873
  • 26
  • 254
  • 302
Jannis
  • 9
  • 1
  • 1
    Please post code, not a picture of code. No-one can run a picture. – access violation Nov 09 '22 at 17:44
  • 1
    What do you mean? Should I copy paste my code as a comment here? – Jannis Nov 09 '22 at 17:48
  • 1
    You should [edit](https://stackoverflow.com/posts/74379199/edit) your question. Most probably you are either running different main method or running the old code. – Chaosfire Nov 09 '22 at 17:51
  • 1
    [Please post text, not images.](https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors-when-asking-a-question/285557#285557) – Dave Newton Nov 09 '22 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? – Jannis Nov 09 '22 at 18:03

1 Answers1

2

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

kind regards!

Dean
  • 64
  • 8