这是我的java代码...我想让它在编译一次后再次双击运行..! 请指导我如何制作这个..?
import java.util.Scanner;
public class Functions {
public static int addnumbers(){
Scanner input = new Scanner(System.in);
int a,b;
System.out.println("\nMethod Call - Addition");
System.out.print("\nEnter a = ");
a=input.nextInt();
System.out.print("Enter b = ");
b=input.nextInt();
return(a+b);
}
public static int subnumbers(){
Scanner input = new Scanner(System.in);
int a,b;
System.out.println("Method Call - Subtraction");
System.out.print("\nEnter a = ");
a=input.nextInt();
System.out.print("Enter b = ");
b=input.nextInt();
return(a-b);
}
public static int mulnumbers(){
Scanner input = new Scanner(System.in);
int a,b;
System.out.println("Method Call - Multiply");
System.out.print("\nEnter a = ");
a=input.nextInt();
System.out.print("Enter b = ");
b=input.nextInt();
return(a*b);
}
public static int quonumbers(){
Scanner input = new Scanner(System.in);
int a,b;
System.out.println("Method Call - Quotient");
System.out.print("\nEnter a = ");
a=input.nextInt();
System.out.print("Enter b = ");
b=input.nextInt();
return(a/b);
}
public static void main(String args[]) {
Scanner input = new Scanner(System.in);
int n;
System.out.println("**Calcultor**\n\n1.Addition\n2.Subtraction\n3.Multiplication\n4.Quotient");
System.out.print("\nEnter no : ");
n=input.nextInt();
if(n==1) {
System.out.println("\nResult = "+addnumbers());
}
if(n==2) {
System.out.println("\nResult = "+subnumbers());
}
if(n==3) {
System.out.println("\nResult = "+mulnumbers());
}
if(n==4) {
System.out.println("\nResult = "+quonumbers());
}
System.out.println("\nControl exit!");
}
}
告诉我任何办法......