Results 1 to 3 of 3
Thread: Odd java code error
- 02-01-2012, 04:46 PM #1
Member
- Join Date
- Feb 2012
- Location
- Mississippi
- Posts
- 2
- Rep Power
- 0
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?
- 02-01-2012, 04:50 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,400
- Blog Entries
- 7
- Rep Power
- 17
Re: Odd java code error
The package is named "java.util", not "java.until".
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 02-01-2012, 04:55 PM #3
Member
- Join Date
- Feb 2012
- Location
- Mississippi
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
New to Java, cant figure out why im getting this error code.
By JBeese in forum New To JavaReplies: 5Last Post: 06-05-2011, 02:19 AM -
Error using xml-rpc with java code
By mith86 in forum New To JavaReplies: 1Last Post: 01-04-2011, 02:48 PM -
Java code giving error
By alfarida in forum New To JavaReplies: 3Last Post: 11-10-2010, 07:11 PM -
Java code error!~ Please help
By socboy6579 in forum New To JavaReplies: 1Last Post: 10-15-2010, 03:47 AM -
trying to improve code to avoid java.lang.OutOfMemory error
By bdyarem in forum New To JavaReplies: 16Last Post: 08-05-2008, 11:34 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks