• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Quick question about the date class

 
Jim Stevens
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So i was told to create a credit card class and include the date class in it. I have a tester program to check through my created class. The only test i have failing is test 11. It says that getDateAccountOpened changes date that account was opened. Not to sure about what is going on. A little guidence would be awesome. i will attach the program and test program.

This is my credit card class



 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15448
42
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jim evnas wrote:It says that getDateAccountOpened changes date that account was opened.

Look at the code. Can you explain what it is doing?
 
Jim Stevens
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Date date = new Date(); I assume this imports the use of the Date class. The return date only returns the date to the main program. I honestly am not to sure...
 
Philip Grove
Ranch Hand
Posts: 68
Firefox Browser Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to look into what happens when you get to the line


Hint: It's very clear when you look at the documentation.

You probably need to look into the Calendar class (it's abstract) unless you want to save date as milliseconds since the epoch. While it does have it advantages in many situations absolute dates might be easier to understand than relative values.
 
Jim Stevens
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic