multi.java

来自「在Java中实现数字的加、减、乘、除等运算。」· Java 代码 · 共 40 行

JAVA
40
字号
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package calculatrice;/** * * @author Loïc */public class Multi extends Operateur {     public String afficher(){     return "*";     };          public void operer(Pile p){     if(p.estvide()==false){         int val1=p.depiler();         int val2=p.depiler();         p.empiler(val1*val2);        }    }     public static void main(String args[]){    /*test de la methode operer*/            Pile p=new Pile(3);        Multi pl=new Multi();        int res;        p.empiler(1);        p.empiler(2);        pl.operer(p);        res=p.depiler();        System.out.println(res);}     }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?