Use a method in another method?

This is my code ( in BlueJ environment)

import java.io.*;

publicclass PrimePerfectSpecialMenu

{

privateint cu, nu, f;

private String n,c;

publicvoid check()throws IOException

{

InputStreamReader isr =new InputStreamReader(System.in);

BufferedReader br =new BufferedReader(isr);

System.out.println("Enter a number");

n=br.readLine();

System.out.println("1.Prime \n2.Perfect \n3.Special \n4.Quit");

c=br.readLine();

cu = Integer.parseInt(c);

int nu = Integer.parseInt(n);

switch(cu)

{

case 1:int a=0;

for(int i=1;i<=nu;i++)

{

if(nu%i==0)

a++;

}

if (a>2)

System.out.println("Not a prime number");

else

System.out.println("Prime number");

break;

case 2:int b=0;

for(int i=1;i<nu;i++)

{

if(nu%i==0)

b=b+i;

}

if (nu==b)

System.out.println("Perfect number");

else

System.out.println("Imperfect number");

break;

case 3:

}

}

privateint factorial(int a)

{

f=a;

a=a-1;

while(a!=0)

{

f=f*a;

a--;

}

return f;

}

}

I want to use the factorial method inside the case 3 of the switch statement, how would i go about doing this

I tried factorial fact = new factorial(), but it doesnt work( error : cannot resolve symbol class factorial)>

[3150 byte] By [Overkilla] at [2007-11-27 8:38:05]
# 1
methods do not need to be newedjust useint fact = factorial(numberFactorialed);then variable fact will have the number that is = to the factorial of variable numberFactorialed
seegreena at 2007-7-12 20:35:37 > top of Java-index,Java Essentials,Java Programming...
# 2
Ohh kk.Thanks a lot man :)
Overkilla at 2007-7-12 20:35:37 > top of Java-index,Java Essentials,Java Programming...