





public class Forever
{
public static void main (String args[])
{
System.out.println("Loopy is a loopy thing");
System.out.println( "y=" + loopy(23) );
}
public static int loopy(int y)
{
for (int i=0; i <10 ; i++)
{
y=i;
i=3;
}
return y;
}
}
If you like to see the line numbers you can change the Preferences (from the Tools Menu of BlueJ -not the edit window- to look like this:








public static String fromAnyToDec(String theNumber, int base)
{
int decNum=0;
int last=theNumber.length()-1;
for (int i=0; i<= last; i++)
{
int digit=Integer.valueOf(theNumber.charAt(i));
decNum+=digit*Math.pow(base, last-i);
}
return String.valueOf(decNum);
}






int digit=Integer.valueOf(theNumber.charAt(i) );

int digit=Integer.valueOf(theNumber.substring(i, i+1));
