Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes Selection Does not contain a main type? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Selection Does not contain a main type?" Watch "Selection Does not contain a main type?" New topic

Selection Does not contain a main type?

Cameron Jones

Joined: Oct 17, 2011
Posts: 1

what'd I do wrong?
I know I'm a newb, and this is simple...
Tina Smith
Ranch Hand

Joined: Jul 21, 2011
Posts: 171

The method signature you are looking for is

You missed the static keyword, which allows the main method to be run without instantiating the Car class.

P.S. Please use the code tags when posting code.

Everything is theoretically impossible, until it is done. ~Robert A. Heinlein
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 37907
Welcome to the Ranch

I have changed the quote tags to code, and you can see how much better it looks.
jQuery in Action, 2nd edition
subject: Selection Does not contain a main type?
Similar Threads
Is Java too difficult for me? Trying to learn with Head first Javabook
interface example
Confused with output
[enthuware] OO Concepts - Shadowing vs. overriding