二级java真考试卷一
20210625
1<10 i=1+1 j=10-1 k=i+j=9+2=11
二级java真考试卷2
20210626
二级java真考试卷三
20210628
B 命名不规范,首个单词不能是数字
选A
选C
选A
选A
import javax.swing.*;
import java.awt.event.*;
public class Java_2 extends JFrame {
private JButton b;
public Java_2(String s){
setTitle(s);
b=new JButton("Hello");
getContentPane().add(b);
//*********Found********
b.addActionListener( new HandleButton());
setSize(150,150);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//*********Found********
setVisible( true);
}
class HandleButton implements ActionListener{
public void actionPerformed(ActionEvent e){
//*********Found********
if ( "Hello".equals( e.getActionCommand) )
b.setText("你好");
else
b.setText("Hello");
}
}
public static void main(String args[]){
//*********Found********
new java_2("二级java");
}
}
二级java真考试卷四
20210629
A
a