Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Date CLass

 
Bill Ballou
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope this is the right place for this. Ok I am studying for a final test in my java class (groan). I have been trying to run through all of the codes in chapter 8 of Java How to Program 6th edition and I have hit the wall on 8.16. Here are the books requirements:
(Date Class) Create class Date with the following capabilities:

Output the date in multiple formats, such as

MM/DD/YYYY
June 14, 1992
DDD YYYY

Use overloaded constructors to create Date objects initialized with dates of the formats in part (a). In the first case the constructor should receive three integer values. In the second case it should receive a String and two integer values. In the third case it should receive two integer values, the first of which represents the day number in the year. [Hint: To convert the string representation of the month to a numeric value, compare strings using the equals method. For example, if s1 and s2 are strings, the method call s1.equals( s2 ) returns true if the strings are identical and otherwise returns false.]

If anyone could help me with this code or has the code so I can take a look at it I would be extremely grateful. I want to stress that this is not homework and I am not asking for someone to help me cheat. Thanks in advance for any help, and if this is the wrong place to post let me know.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"HellKat",
Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names get deleted, often without warning

thanks,
Dave
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The spec is pretty detailed, so can you tell us exactly which bit you are having trouble with. Post what code you have so far.
 
Steve Morrow
Ranch Hand
Posts: 657
Clojure Spring VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Already answered here:

http://forum.java.sun.com/thread.jspa?threadID=5185374
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic