The method journeyCost
is non-static; so it's an instance method and it requires an instance of Journey
to get executed. The sentence Journey.journeyCost(thisJourney);
is invoking the method in a static way, and its expecting that your method is a class-level method (or static).
So, you can make your journeyCost
method static for your call to work:
public static boolean journey(int date, int time, int busNumber, int journeyType)
Or try invoking the method from a proper instance:
Journey aJourneyInstance = new Journey();
thisJourney.costOfJourney = aJourneyInstance.journeyCost(thisJourney);