Results 1 to 3 of 3
  1. #1
    Craig9008 is offline Member
    Join Date
    Feb 2012
    Location
    Mississippi
    Posts
    2
    Rep Power
    0

    Default Odd java code error

    I am writing a program in school that is coming straight out of my java book, I have typed a segment of code exactly as the book has it and it's saying it can't recognize a portion of code. I have typed:

    /*
    Chapter 2: Welcome to My Day
    Programmer: Craig
    Date: 2/1/2012
    Filename: Welcome.java
    Purpose: This project displays a welcome message, the user's
    name, and the system date in a console application.
    */

    import java.until.Date;

    public class Welcome
    {
    public static void main(String[] args)
    {
    Date currentDate = new Date(); //Date constructor
    System.out.println();
    System.out.println("\t\t\tWelcome to my day!");
    System.out.println("\t\t\tDaily planner for Linda Lunez");
    System.out.println("February 1, 2012");
    System.out.println();
    }
    }

    The error I'm getting is:

    E:\Java\Chpater_2\Welcome.java:10: package java.until does not exist
    import java.until.Date;
    ^
    E:\Java\Chpater_2\Welcome.java:16: cannot find symbol
    symbol : class Date
    location: class Welcome
    Date currentDate = new Date(); //Date constructor
    ^
    E:\Java\Chpater_2\Welcome.java:16: cannot find symbol
    symbol : class Date
    location: class Welcome
    Date currentDate = new Date(); //Date constructor
    ^
    3 errors

    Tool completed with exit code 1


    Apparently it doesn't recognize "Date" can anyone tell me why?

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,309
    Blog Entries
    7
    Rep Power
    20

    Default Re: Odd java code error

    The package is named "java.util", not "java.until".

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Craig9008 is offline Member
    Join Date
    Feb 2012
    Location
    Mississippi
    Posts
    2
    Rep Power
    0

Similar Threads

  1. Replies: 5
    Last Post: 06-05-2011, 02:19 AM
  2. Error using xml-rpc with java code
    By mith86 in forum New To Java
    Replies: 1
    Last Post: 01-04-2011, 02:48 PM
  3. Java code giving error
    By alfarida in forum New To Java
    Replies: 3
    Last Post: 11-10-2010, 07:11 PM
  4. Java code error!~ Please help
    By socboy6579 in forum New To Java
    Replies: 1
    Last Post: 10-15-2010, 03:47 AM
  5. Replies: 16
    Last Post: 08-05-2008, 11:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •