Hi All,
I am a total java novice and i am having a real problem running the following code:
import java.util.*;
public class Methods
{
public static void main( String [] args)
{
Date independenceDay = new Date ( 7, 4, 1776 );
int independenceMonth = independenceDay.getMonth();
System.out.println("Independence day is in month " + independenceMonth);
Date graduationDate = new Date (5, 15, 2008);
System.out.println("The current day for graduation is " + graduationDate.getDay() );
graduationDate.setDay(12);
System.out.println( "The revised day for graduation is " + graduationDate.getDay() );
}
}
This is actually from a book i am working through and if it isn't working i was wondering if there was something wrong with the code or my pc.
The error message reads:
1 error found:
File: C:\Documents and Settings\Steven\Desktop\Methods.java [line: 16]
Error: cannot find symbol
symbol : method setDay(int)
location: class java.util.Date
Please help
Thanks
Sarah
x