5/18/2011

import Type to .jpage/ Scrapbook page

My Java teacher mentioned Array in Hybrid class this evening. In the following example, we set several numbers in an Array and we are going to rank them. However, it did not work when I tried it in class.


At first, I select the codes and it shows error message.


I asked my teacher and he told me that I should import java.util.Arrays. Well, when I typed "import java.util.Arrays" as the same as I usually did in .java file, it still didn't work. And showed the error message again.


Suddenly, something came into my mind. Maybe I should import java.util in a different way because I am working in Scrapbook instead of .java file! The steps are almost the same when I import Package into Scrapbook page. The steps are as follows.

right-click => set import


 right-click => set import => Add Type


right-click => set import => Add Type => click on Arrays-java.util => click OK


Then, we will go back to our Scrapbook page. java.util.Arrays is imported in Scrapbook page but it wont' show on the screen.


Select codes again and right-click Display.


It finally works and the result shows on the concole.






No comments:

Post a Comment