File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Need help creating object, unsure of parameters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Need help creating object, unsure of parameters" Watch "Need help creating object, unsure of parameters" New topic
Author

Need help creating object, unsure of parameters

Travis Hagan
Greenhorn

Joined: Dec 21, 2008
Posts: 12
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

Joined: May 22, 2006
Posts: 35
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

Joined: Dec 21, 2008
Posts: 12
Okay, that worked. I guess it was the quotes. Thank you!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help creating object, unsure of parameters