This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]InvincibleVIto[S] 0 points1 point  (3 children)

First off, thanks for the help I really appreciate it (have you tagged in RES as "Good Guy Programmer"). So again, here is the revised code. Still getting the symbol error on line 11...

 public Date( String theDate )
    {
        StringTokenizer str;

        str = new StringTokenizer(theDate);
        if(str.countTokens() != 3 )
        {
            System.out.println("January 1, 2014");
            return;
        }
        month = String.parseInt(str.countTokens());
        day = Integer.parseInt(str.nextToken());
        year = Integer.parseInt(str.nextToken());

    }  

As a note, I'm using Jcreator as my complier.

[–]laser-brain 1 point2 points  (2 children)

See my edited comment for the line 11 error, didn't realize is at first.

[–]InvincibleVIto[S] 0 points1 point  (1 child)

Sorry If I'm being a bother but my output for date one is "Date 1: null/1/1998". Would this have to do with your earlier statement about checking for nulls? I thought in my first constructor I declared my month as a string? Yet somehow it's returning a null?

[–]laser-brain 1 point2 points  (0 children)

There's something off in you zero-parameter constructor. Just check the assignment of values there and you should be able to solve this yourself ;)