• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Object creation

 
Mary Taylor
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an Object which consists of a Date and a Vector. I'm glad this is a Beginner Forum because I'm sure what I'm missing is simple. Here is some code:
newObject (Date myDate, Vector my Vector);
public void createNewObject(Vector inVector){
Date newDate = new Date();
newObject myObject = new newObject(newDate, inVector);
The message I get is that the compiler cannot resolve the symbol "new" in the creation of newObject. Suggestions?
 
Ron Newman
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you post all of your code, not just this fragment? In particular, show us the "newObject" class.
 
Wilfried LAURENT
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...and the exact compiler error message.
W.
 
Mary Taylor
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was working with my code and someone else's together and didn't notice they were using the default constructor, and those fields were data members and not parameters. Sorry, guys. Thanks.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic