题目内容

阅读下列程序,请写出该程序的输出结果。 public class Test33{ static int x=1; int y=0; Test33() { x++;y++; } public static void main(String[] args) { Test33 st=new Test33(); System.out.println("x="+x); System.out.println("st.y=" +st.y); st=new Test33(); System.out.println("x="+x); System.out.println("st.y="+st.y); } }

查看答案
更多问题

阅读下列程序,请写出该程序的功能。 import java. applet. *;import java.awt.*;import java. awt. event. *; public class Test36 extends Applet { final int inc=25; int max=500;int min=200; Dimension d; public void init() { addMouseListener(new MouseAdapter() ){ public void mouseReleased(MouseEvent me){ int w=(d. width+inc)>maxmin:(d. width+inc); int h=(d. height+inc)>maxmin:(d. height+inc); setSize(new Dimension(w,h)); } } } public void paint(Graphics g){ d=getSize(); g. drawLine(0,0,d. width-1,d. height-1); g. drawLine(0,d. height-1,d. width-1,0); g. drawRect(0,0,d. width-1,d. height-1); }}

小应用程序设置一个文本区、一个文本框和两个按钮。用户在文本区中输入整数序列,单击求和按钮,程序对文本区中的整数序列进行求和,并在文本框中输出计算结果。单击第二个按钮,清除文本区和文本框中内容。注:这里是给定程序的部分代码,你要编写的是actionPerformed(ActionEvent e)方法。 import java.util. *;. . . . . . . . . public class Test38 extends Applet implements ActionListener { JTextArea textA; JTextField textF; JButton b1,b2; public void init() { textA=new JTextArea("",5,10); textF=new JTextField("",10); b1=new JButton("求和");b2=new JButton("重新开始"); b1. addActionListener(this);b2. addActionListener(this); add(textA);add(textF);add(b1);add(b2); ……..}public void actionPerformed(ActionEvent e){ //请在以下位置编写代码(例题Example5_9)}

阅读下列程序,请写出该程序的输出结果。public class Test32{public static void main(String[] args){ int i,j; for(i=0;i<5;i++){for(j=1;j<5-i;j++)System.out.print(" "); for(j=0;j<=i;j++)System.om.print(’"*"); System. out. Println( ); } } }

银行内部监督部门应向______提供独立的综合理财业务风险管理评估报告。

A. 中国银行业协会
B. 中国银监会
C. 中国人民银行
D. 董事会和高级管理层

答案查题题库