Java Set and Get variable in other function -


i'm trying variable function in same .java file.

this example:

public static void showwindow(user user) {     string checklist = null;      if (user.getnetconnection().getbonus() >= 0.)     {         checklist = "variable1";     }     else     {         checklist = "variable2";     }     showcommunity(user, checklist); }  private static void loadsingle() {     allsingle = new linkedlist<>();     try (connection con = databasefactory.getinstance().getconnection();         preparedstatement statement = con.preparestatement(checklist);         resultset rset = statement.executequery())...(the rest of funcion here) 

there anyway use variable checklist function showwindow inside function loadsingle?

not sure if made typo or what, defining variable checkbufflist never using.

if in fact typo, should able defining static variable , getter, this

private static string checklist;  public static string getchecklist(){     return checklist; } 

so if want call same class can use checklist, if need outside class call classname.getchecklist().


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -