12345678910111213141516171819202122232425262728293031323334 |
- import java.util.*;
-
- public class Operations
- {
- // instance variables - replace the example below with your own
- private int x;
-
- /**
- * Constructor for objects of class Operations
- */
- public Operations()
- {
- // initialise instance variables
- x = 0;
- }
-
- /**
- * An example of a method - replace this comment with your own
- *
- * @param y a sample parameter for a method
- * @return the sum of x and y
- */
- public int factorial(int number)
- {
- int fact = 1;
- for(int i = 1; i <= number; i++) {
- fact *= i;
- }
- return fact;
- }
-
- public int
- }
|