Bookmark Topic Watch Topic
  • New Topic

How can I call the method so I can print?  RSS feed

 
Andres Soto
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Report post to moderator
I HAVE TO USE
d1.getShortDate() // returns the date as mm/dd/yyyy


And test class
 
Alix Ollivier
Ranch Hand
Posts: 71
Java Linux Mac
  • Mark post as helpful
  • send pies
  • Report post to moderator
First of all, you double posted. Second of all, I don't quite understand what you want. Can you explain a bit more? Thanks.
 
Aj Prieto
Ranch Hand
Posts: 75
Android Chrome Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
You've already instantiated the SpeedDating class with the variable thanksgiving.

Therefore instead of:


It should be:
 
Andres Soto
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Report post to moderator
Thank you aj! There was a logic error located in the loop but i fixed and got iy to run! Thank you very much!
 
Kemal Sokolovic
Bartender
Posts: 825
5
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Report post to moderator
First of all, you double posted.


Actually almost the same thread has already been started here.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
There are some bugs in your code that haven't been mentioned yet.

First, the constructor of class Date that takes a day, month, year is deprecated. That means you shouldn't use it. The API documentation of the constructor also says what you should use instead.

Second, you're using the constructor with incorrect parameters. The parameters are: day, month, year. You are calling it with the day and month parameters reversed.

Third, months start at 0. So, November is 10, not 11, and October is 9, not 10.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
Kemal Sokolovic wrote:Actually almost the same thread has already been started here.

Indeed, so let's close this one and continue in the other topic.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!