久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      Java中next與nextLine方法有什么不同

      Java中next與nextLine方法有什么不同

      next()方法會將空格識別為輸入結(jié)束的標識。

      (推薦教程:java入門教程)

      代碼示例:

      String str1 = sc.next(); System.out.println(str1);
      輸入 abcd efg 輸出 abcd

      nextLine()方法會將換行識別為輸入結(jié)束的標識。

      (視頻教程推薦:java視頻教程)

      代碼示例:

      String str1 = sc.nextLine(); System.out.println(str1)

      總結(jié):

      需要空格截斷輸入的情況使用next(),比如輸入1(空格)2,可以得到a=1,b=2;

      需要含空格的情況使用nextLine(),如輸入1(空格)2,可以得到a = 1(空格)2。

      贊(0)
      分享到: 更多 (0)
      ?
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號