此博客随时补充一些零碎知识点
===============================
显示一个弹窗:
import javax.swing.JOptionPane;
JOptionPane.showMessageDialog(null,"平均值为: " + result / 5); //弹出对话框输出
跳过回车键,否则下次读入回车
System.in.skip(2);
读取一个字符:
system.in.read(); // 读取的为字符对应的ascii码,类型:int
数组注意:
声明数组不能写具体的大小,需要在new时指定,或初始化时(间接指定)
如 int a[5] = {1,2,3,4,5}; // 错误
标签块:
在某代码块前加----标签名:
java中弃用goto,可以使用(break 标记名;) (continue 标记名;)实现跳转