27-JAVA scanner类与某些快捷键
生活随笔
收集整理的這篇文章主要介紹了
27-JAVA scanner类与某些快捷键
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
scanner類的使用
package mypro1;import java.util.Scanner; /*** 測試Scanner類的使用,如何接受鍵盤的輸入* @author jason* @version **/ public class TestScanner {public static void test01(){Scanner s= new Scanner(System.in);String str=s.next();System.out.println("剛才鍵盤輸入:"+str);}public static void test02(){Scanner s= new Scanner(System.in);System.out.println("請輸入一個(gè)加數(shù)");int a=s.nextInt();System.out.println("請輸入另一個(gè)被加數(shù)");int b=s.nextInt();int sum=a+b;System.out.println("計(jì)算結(jié)果:和為"+sum);}public static void main(String[] args) {test02();}}Main確認(rèn)快速鍵
main+Alt(長按)+/+enter
= public static void main(String[] args) {
}
Syso輸出快速鍵
syso+Alt(長按)+/+enter
System.out.println();
移動(dòng)代碼向上向下:alt+ 向上鍵向下鍵
方法覆寫:alt+shift+s+override出現(xiàn)選定
多行注釋快捷鍵?1:添加注釋 Ctrl+Shift+/ : ? ?添加/* */注釋?
https://blog.csdn.net/wjeson/article/details/9119037
總結(jié)
以上是生活随笔為你收集整理的27-JAVA scanner类与某些快捷键的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 爱彼迎数据分析
- 下一篇: 扩充antd的Icon图标库