JAVA
解决JAVA基础使用中的一些问题
long-2000
这个作者很懒,什么都没留下…
展开
-
eclipse常用快捷键
Ctrl+1 快速修复(最经典的快捷键,就不用多说了,可以解决很多问题,比如import类、try catch包围等) Ctrl+Shift+F 格式化当前代码 Ctrl+Shift+M 添加类的import导入 Ctrl+Shift+O 组织类的import导入(既有Ctrl+Shift+M的作用,又可以帮你去除没用的导入,很有用) Ctrl+Y 重做(与撤销Ctrl+Z相反) Alt+/ 内容辅助(帮你省了多少次键盘敲打,太常用了) Ctrl+D 删除当前行或者多行 Alt+↓ .原创 2021-01-06 11:34:28 · 87 阅读 · 0 评论 -
System.setOut()和System.setIn()
System.setOut()改变输出流对象 public static void main(String[] args ) { try { PrintStream out = System.out; PrintStream ps = new PrintStream("D:/log.txt"); System.setOut(ps); int age = 18; System.out.println("年龄重定义成功,初始值为18"); String sex = "女"; Sys原创 2021-01-06 10:49:16 · 394 阅读 · 0 评论 -
JAVA中“Cannot make a static reference to the non-static method nextLine() from the type Scanner”的解决方法
JAVA中“Cannot make a static reference to the non-static method nextLine() from the type Scanner”的解决方法 一个简单的从控制台接收输入的身份证号,按照所给代码打出 public class InputCode { public static void main(String[] args) { Scanner scan = new Scanner(System.in); //创建输入流扫描器 Sy原创 2021-01-05 18:08:55 · 429 阅读 · 0 评论