The Static Method should be accessed in a static way

Hi, I am working on a little java class that accesses another class to display the day of the week.

The code looks like this

import java.util.Calendar;

import java.util.GregorianCalendar;

import java.util.Scanner;

public class DateTime

{

public static void main(String [] args){

WeekDay WD = new WeekDay();

Calendar currentDate =new GregorianCalendar();

int currentWeekDay = currentDate.get(Calendar.DAY_OF_WEEK );

String name =null ;

Scanner keyboardInput =new Scanner(System.in );

System.out .println("What is your name?");

name =keyboardInput.nextLine();

System.out .println("Hello, "+name+" it is "+ WD.getWeekDay(currentWeekDay) +".");

}

}

The program runs but in eclipse it shows a little yellow line under WD.getWeekDay(currentWeekDay) with a warning that says "the static method getWeekDay(int) from the type WeekDay should be accessed in a static way." Does anyone know what my prob is?

[1015 byte] By [TheBigBada] at [2007-10-3 6:42:41]
# 1

try

System.out.println("Hello, "+name+" it is "+ WeekDay.getWeekDay(currentWeekDay) +".");

Also, if you follow any of the java coding standards, please start variables with a lower case: The variable WD should be wd

Caffeine0001a at 2007-7-15 1:31:55 > top of Java-index,Archived Forums,Debugging Tools and Techniques...
# 2
Thanks That fixed it. You Da Man
TheBigBada at 2007-7-15 1:31:55 > top of Java-index,Archived Forums,Debugging Tools and Techniques...
# 3
You need to configure the Eclipse compiler in the Preferences->Java->Compiler and disable some error and warning options (e.g., non-static access to static members)
thakrea at 2007-7-15 1:31:55 > top of Java-index,Archived Forums,Debugging Tools and Techniques...