• Post Reply Bookmark Topic Watch Topic
  • New Topic

Eclipsed by error  RSS feed

 
Debbie Schmidt
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone. Newbie here, newbie to Java, newbie to Eclipse....(putting L hand on forehead).

Eclipse keeps telling me: "Selection does not contain a main type" when I try to run the following stack/push/pop exercise. I've stared at it long enough. Any pointers?

Thanks for your suggestions.

 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Debbie, and welcome to the Ranch!

A Java program's entry point (the place at which the code start's executing) is a method with the signature public static void main(String[] args). Your class doesn't have a main method, so the JVM can't run it. Looking at your class, we can see that it has methods defined--that is, it has instructions on how to perform certain operations--but there's no code that ever tells it to perform any of those operations.

Also, when you post code, please UseCodeTags(⇐link) so it will be readable.
 
Debbie Schmidt
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply. I see what you mean now. I told it what parts to use, and how to use each part, but I never tell it to put them all together. Now to work on that part....

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!