java高级编程20xx级卷(编辑修改稿)内容摘要:

ew SimpleFrame()。 标号 1 (300,200)。 标号 2 ()。 标号 3 ()。 } } 2.阅读下述程序, 解释标号 标号 标号 3语句的含义(每句 3分)。 import .*。 import .*。 public class ServerPart { public static void main(String[] args) { try { 标号 1 ServerSocket serverSocket = new ServerSocket(4444)。 标号 2 Socket connSocket = ()。 标号 2 BufferedReader in = new BufferedReader( new InputStreamReader( ()))。 String inStr = ()。 PrintWriter out = new PrintWriter((), true)。 (服务器端反馈 + inStr)。 (服务器端接 收到的消息为: + inStr)。 } catch (IOException e) { (无法监听端口 4444.)。 (1)。 } } } 3. 阅读程序,解释标号 标号 标号 3 语句的含义(每句 3 分)。 import .*。 import。 public class TestThread { public static void main(String args[]) { Runner r=new Runner( )。 标号 1: Thread t1=new Thread(r)。 Thread t2=new Thread(r)。 标号 2: ()。 ()。 } } class Runner implements Runnable { public void run() { for(int i=0。 i20。 i++) { String s=().getName()。 (s+:+i)。 try{ 标号 3: (400)。 } catch(InterruptedException e){ } } } } 4.阅读程序,解释标号 标号 标号 3 语句的含义(每句 3 分 )。 public class ButtonDemo extends JFrame { JPanel panel。 JButton b1, b2。 public static void main (String[] args) { ButtonDemo frame = new ButtonDemo()。 (按钮演示 )。 ()。 ()。 ()。 (true)。 } 密 封 线 内 不 要 答 题 ———————————密———————————————封———————————————线———————————— 共 6 页 第 3 页 public void AddContent() { panel = new JPanel()。 标号 1 b1 = new JButton(向后 )。 b2 = new JButton(打开文件 )。 标号 2 (new Buttonb1ActionListenerClass(this))。 (new Buttonb2ActionListenerClass(this))。 (b1)。 (b2)。 标号 3 getContentPane().add(panel)。 } public void Buttonb1ActionPerformed(ActionEvent e) { (false)。 } public void Buttonb2ActionPerformed(ActionEvent e) { final JFileChooser fc = new JFileChooser()。 int returnVal = (this)。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。