java - Compile error: Cannot be applied to given types -
i getting error when trying compile cannot figure out. have managed fix other errors had (i think, no longer list @ least). have tried figure out , not understanding issue. error occurs:
pastpresentfuture.java:34: error: method determine_past_present_future in class pastpresentfuture cannot applied given types; determine_past_present_future(pastpresentfuture); ^ required: int,int,int found: string reason: actual , formal argument lists differ in length
here called
pastpresentfuture = determine_past_present_future(user_month, user_day, user_year);
and relevant code
public static string determine_past_present_future(int a, int b, int c) { int current_year = 2017; int current_month = 9; int current_day = 10; string date; if ((c < current_year) || (c > current_year)) { date = "not year"; } else if ((a < current_month)) { date = "in earlier month year"; } else if ((a > current_month)) { date = "in later month year"; } else if ((a == current_month)) { date = "this month"; } return date; }
edit* figured out messed method call while watching hurricane updates , focused on wrong area fix didn't need fixed.
as error says
required: int,int,int found: string
this means, calling determine_past_present_future
method passing string
instead need pass 3 parameters of type int
.
Comments
Post a Comment