All pastes #9430 Raw Edit

Mine!

public java v1 · immutable
#9430 ·published 2005-04-12 18:26 UTC
rendered paste body
/***  2 methods below, 1st one entire, 2nd one skeleton*  yes, for generate, could/might set the x/y variables outside of method**  My goal, which I can't figure out how to do is to PASS the value of*  variable "rangeX" created in generate()  to be the value of "length"*  for method 2*  have messed around for quite awhile, not getting anywhere, still newbie*  understand scope of variables is somehow hindering this process but not *  sure what to do.*  *  Thank you!**////////////////////////////<Method 1> ////////////////////////////////private static int generate(int x, int y) {  x = 5;  y = 6;  int range = y - x + 1;  int rangeX;  //return (Math.random() * range) + x;  rangeX = (int)(Math.random() * range) + x;  return rangeX;}///////////////////////////<END Method 1> ///////////////////////////////////////////////////////////<Method 2> ////////////////////////////////private static String randomString (int length) {       }///////////////////////////<END Method 2> ////////////////////////////////