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?

