使用
下载: https://soot-build.cs.uni-paderborn.de/public/origin/develop/soot/soot-develop/build/
test file:
package TriangleClass;
public class Triangle {
public String triangle(int a, int b, int c){
if(a > 0 && b > 0 && c >0){
if(a + b >c)
{
if(a == b || b ==c || a ==c)
{
if(a == b && b == c)
{
return "equilateral";
}
return "isosceles";
}
else{
return "scalene";
}
}
else{
return "Not Triangle";
}
}
else{
return "Not Triangle";
}
}
public int a;
public int b;
public int c;
}
javac Triangle.java
java -cp soot-trunk.jar soot.tools.CFGViewer --soot-classpath .;"%JAVA_HOME%"\jre\lib\rt.jar TriangleClass.Triangle
网友评论