下列是一个Java Applet程序,填空使它的功能为计算数组各元素和的平均值。 import java app
A.正确
B.错误
从下面提供的答案中选出应填入下列英文语句中______内的正确答案。
The most accurate and most boring way to(1)Java is that it is a new computer programming language developed by Sun Microsystems that creates(2)independent programs that can be distributed and run remotely. To run Java programs,a computer must have a Java interpreter. Currently(3)Java programs are small "applets" that are(3)as part of web pages.
When you use a Java(4)browser to view a Web page that includes a Java applet, the browser loads the applet onto your computer through your modem or network. Then the Java interpreter runs the applet, which could include animation or sound, on your computer rather than transmitting the code bit by bit over Internet. Afew thousand bytes of Java code can turn into a powerful program on your computer.
So an applet could include(5)with Java interpreter.
A.在JAVA程序中要使用一个变量,必须先对其进行声明
B.变量声明语句可以在程序的任何地方,只要在变量使用前就可以
C.变量不可以在其作用域之外使用
D.局部变量在使用之前可以不初始化,系统使用默认的初始值
下列程序实现的功能是当按下键盘时,在Applet中通过paint()方法,在(50,50)位置处显示出按下的键的名称。在横线处填写正确的语句。 import java.awt.*; import java.awt.event.*; import java.applet.*; public class Test7 extends Applet { String str=""; public void init() { addKeyListener (new KeyAdapter() { public void keyPressed(KeyEvent ke) { 【 】; repaint(); } }); requestFocus(); } public void paint(Graphics g) { g.drawString("你按下的键是:" +str, 50,50); } }