刚刚制作了一个计算器类型的简单程序....我需要一种方法将其编译为可运行的 jar...我如何在 Eclipse 中执行此操作...我对编程很陌生,所以如果我不是很了解,请原谅我在我的问题中明确...
这是我的源代码
package lvlup;
import java.awt.color.*;
import java.math.*;
import java.util.Scanner;
public class methods {
public methods(){
System.out.println("Choose an option/n");
System.out.println(" press 1 for derivative calculator (known polynomials)");
int Choice;
Scanner c = new Scanner(System.in);
Choice = c.nextInt();
switch (Choice){
case 1:
derCal();
}
}
private void derCal() {
double x;
double n;
long der;
Scanner sc = new Scanner (System.in);
System.out.println("welcome to the derivative calc");
System.out.println("insert x");
x = sc.nextDouble();
System.out.println("insert n now/ n=1 default");
n = sc.nextDouble();
der = (long) (n*Math.pow(x, n-1));
System.out.println("the answer is :" + der);
}
public static void main (String args []){methods m = new methods();
}
}