早教吧作业答案频道 -->其他-->
java的类谢谢写一个计算器类Calculator,完成对两个数的加减乘除运算。
题目详情
java的类 谢谢
写一个计算器类Calculator,完成对两个数的加减乘除运算。
写一个计算器类Calculator,完成对两个数的加减乘除运算。
▼优质解答
答案和解析
import java.awt.*;
import java.awt.event.*;
public class TestWindowClose {
public static void main(String args[]) {
new MyFrame55("MyFrame");
}
}
class MyFrame55 extends Frame {
MyFrame55(String s) {
super(s);
setLayout(null);
setBounds(300, 300, 400, 300);
this.setBackground(new Color(204, 204, 255));
setVisible(true);
//this.addWindowListener(new MyWindowMonitor());
this.addWindowListener(
new WindowAdapter() {
public void windowClosing(WindowEvent e) {
setVisible(false);
System.exit(-1);
}
});
}
/*以下是内部类的写法
class MyWindowMonitor extends WindowAdapter {
public void windowClosing(WindowEvent e) {
setVisible(false);
System.exit(0);
}
}
*/
}
import java.awt.event.*;
public class TestWindowClose {
public static void main(String args[]) {
new MyFrame55("MyFrame");
}
}
class MyFrame55 extends Frame {
MyFrame55(String s) {
super(s);
setLayout(null);
setBounds(300, 300, 400, 300);
this.setBackground(new Color(204, 204, 255));
setVisible(true);
//this.addWindowListener(new MyWindowMonitor());
this.addWindowListener(
new WindowAdapter() {
public void windowClosing(WindowEvent e) {
setVisible(false);
System.exit(-1);
}
});
}
/*以下是内部类的写法
class MyWindowMonitor extends WindowAdapter {
public void windowClosing(WindowEvent e) {
setVisible(false);
System.exit(0);
}
}
*/
}
看了 java的类谢谢写一个计算器...的网友还看了以下:
由代数式的乘法法则类比推导向量的数量积的运算法则:①“mn=nm”类比得到“a·b=b·a”;②“ 2020-05-14 …
小白求教Matlab初级编程.q0=10;R=60;L=9;C=0.00005;t=0:0.8;q 2020-05-17 …
T=2π√L/g若T=2s,则L等于1这是为什么若T=2时,2=2π√L/10m/s²那π是怎么约 2020-06-12 …
c语言,t为int类型,进入下面的循环之前t的值为0,以下叙述正确的是t为int类型,进入下面的循 2020-06-15 …
由代数式的乘法法则类比推导向量的数量积的运算法则:①“mn=nm”类比得到“•=•”;②“(m+n 2020-06-27 …
某同学用单摆测当地的重力加速度.他测出了摆线长度L和摆动周期T,如图(a)所示.通过改变悬线长度L 2020-07-08 …
英语单词填空1.时间状语:d-r-n-2.场所:b-s-s-o-f-r--e-a-t-e-t3.教 2020-07-14 …
对于二次函数C:y=x2-4x+6和一次函数l:y=-x+6,把y=t(x2-4x+6)+(1-t 2020-07-22 …
某同学用单摆测当地的重力加速度.他测出了摆线长度L和摆动周期T,如图(a)所示.通过改变悬线长度L 2020-07-30 …
怎么计算二阶微分方程(mathematrica)我想用mathematica5来书写,但是我又不知 2020-07-31 …