摘要: 思路;用老师给的类创建窗口和随机字母验证码。然后用户输入,对比是否正确 流程图 随机验证码-》用户输入—》判断——》结束 代码 import javax.swing.JOptionPane;public class zuoye1 { public static void main(String[] 阅读全文
posted @ 2017-10-08 21:00 pangkaxxxl 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 有错,一个类中只能有一个PUBLIC类。 2把main()方法的返回值由 void 改为 int ,程序能编译通过吗?能运行吗? 答:不能,int型需要返回值的,没有返回值编译不能通过。 3 X+Y=100200 300=X+Y 如果在string字符串后面是+和变量,会把变量转换成string类型 阅读全文
posted @ 2017-10-08 20:23 pangkaxxxl 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 编写一个程序,从命令行接收多个数字,求和之后输出结果。 思路:用FOR循环输入,此时的输入时STRING.再用函数转换成INT进行计算。 import java.util.Scanner;public class zuoye1 { public static void main(String[] a 阅读全文
posted @ 2017-10-08 20:13 pangkaxxxl 阅读(111) 评论(0) 推荐(0) 编辑