ArrayUtil causes an unexpected error in Java

Whenever I write code that includes ArrayUtil, it causes an unexpected error:

int[] values = ArrayUtil.randomIntArray(30, 300);

I use Eclipse to write my code, and there is always a red underline in the "ArrayUtil" section. What am I doing wrong?

+2
source share
5 answers

Which package does your ArrayUtil own? No one can answer with certainty without this information.

Did you get here ? If so, your signature looks correct. You probably haven't imported it yet, or the class is not in your CLASSPATH. Eclipse tells you to fix one or the other.

0
source

, , squiggly Eclipse:

  • ( ). . ( ), .
  • Ctrl + 1 , , Eclipse . Eclipse , ; .
  • , " ", .

, , , , ArrayUtil Eclipse . , ArrayUtils Apache Commons Lang. , , ArrayUtil, .

, Eclipse -, Commons-Lang . , - ( , ), . , ArrayUtil .

+7

Eclipse , ArrayUtil. import ?

0

Java API , Eclipse . , Java EE 5, "ArrayUtils", "s", Apache commons, , ? jar .

0

, ArrayUtil.randomIntArray(30, 300);

, jar classess, .

, , , , java builtin util, , url

http://java.about.com/od/javautil/a/randomnumbers.htm

http://www.javapractices.com/topic/TopicAction.do?Id=62

0

All Articles