-
-
阅读下列程序,写出程序运行结果。class A{int x,y;A(int xx,int yy){x=xx;y=yy;}}interface A3202{int f3202(A a);}interface B3202{int g3202();}public class C3202 extends A implements A3202,B3202{A a=new A(x,y);C3202(int x,int y){super(x,y);this.x=x*x;this.y=y*y;}public int f3202(A a){return x*a.x+x*a.y;}public int g3202(){return x*a.x+x*a.y;}public static void main(String[] args){int x=10,y=20;A a=new C3202(x,y);C3202 c=new C3202(x,y);System.out.println(a.x+","+a.y);System.out.println(c.f3202(a));System.out.println(c.g3202());}}
-
-
-
-
-
[简答题] 阅读下列程序,请用简述程序运行时呈现的界面。import java.applet.*;import java.awt *;import javax.swing.*;class MyPanel extends JPanel {JButton button; JLabel label;MyPanel(String s1, String s2) {this.setLayout(new GridLayout(2, 2));button = new JButton(s1);label = new JLabel(s2, JLabel.CENTER);add(button); add(label); add(new JLabel());}}public class Class1 {public static void main(String args[]) {JFrame mw = new JFrame("一个示意窗口");mw.setSize(400, 250);Container con = mw.getContentPane();con.setLayout(new BorderLayout());MyPanel panel1, panel2;panel1 = new MyPanel("按钮1" ,"标签1");panel2 = new MyPanel("按钮2", "标签2");JButton button = new JButton("开始按钮");con.add(panel1, "North");con.add(panel2, "South");con.add(button, "Center");mw.setVisible(true);}}
-
-
-