File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help creating object, unsure of parameters

 
Travis Hagan
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm taking a Computer Science class and there is a program called auction that I'm trying to create an "person" object. The program simulates an auction where the user creates different lots (or items to sell) and the people. So far I can't get it to create a person object. Could someone review the code and let me know if it's missing anything and let me know what it is looking for? I have tried several things. I think it is looking for a certain string in the parameter box but I haven't yet found anything that works.

 
Kuldeep Tewari
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you trying to create a new instance?

new Person("yourName"); should work. But, if you are doing new Person(); then you will have to explicitly define empty constructor in your class.

public Person(){}
 
Travis Hagan
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, that worked. I guess it was the quotes. Thank you!!!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic