Skip to content

Commit f792191

Browse files
invoke current class method
1 parent 3a3988f commit f792191

1 file changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
public class InvokeCureentClass {
2+
void method1(){
3+
System.out.println("Method_1 is invoked.");
4+
System.out.println("Factorial of 5 is:");
5+
int f=1,i;
6+
for(i=1;i<=5;i++){
7+
f=f*i;
8+
}
9+
System.out.println("Result is:"+f);
10+
}
11+
void method2(){
12+
method1();
13+
}
14+
public static void main(String args[]){
15+
InvokeCureentClass obj = new InvokeCureentClass();
16+
obj.method2();
17+
}
18+
}

0 commit comments

Comments
 (0)