• Post Reply Bookmark Topic Watch Topic
  • New Topic

Program format - where to put main()?  RSS feed

 
Gunslinger
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi gang,

Not really sure about my placement here, if I put public static void main() outside of the class, it gives me 'should have class or interface' warnings, but if I put it inside, it says that my class Numbers is abstract, and won't accept the object. What gives?

 
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The main method should go inside the class definition.

The problem you have is that you accidentally left off the s from Numbers.

Number is an abstract class.
 
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Keith Lynn is quite correct. There is a Number class in the java.lang package, which is the superclass of the "wrapper" classes Integer, Long, Short, Byte, Float and Double.
 
James Brooks
Gunslinger
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, guys, it's always the little things, it seems!

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