Java基礎知識整理(一)

來源:互聯網
上載者:User

標籤:sed   system   parse   複製   hello   string   java基礎   amp   類型轉換   

Java開發環境JDK(Java編輯器、Java運行工具(JRE作用)、Java文檔產生工具、Java打包工具)

1.Java是嚴格區分大小寫。
2.Java程式中一句連續的字串不能分開在兩行書寫,
   eg:System.out.println("hello
        world!");會報錯
3.使用+=、-=、*=、/=、%=運算子進行複製時,強制類型轉換自動完成,不需要做顯式聲明;
4.&和|無論如何兩邊都執行,&&和||執行完左邊不符合才執行右邊;
5.八種基本類型和String的轉換;
1)String s="11";
      byte b=Byte.parseByte(s);
      short st=Short.parseShort(s);
      int i=Integer.parseInt(s);
      long l=Long.parseLong(s);
      float f=Float.parseFloat(s);
      Double d=Double.parseDouble(s);
      char c[]=s.toCharArray();
2)byte/short/int/long/float/Double i=1111;
      String s=String.valueOf(i);
      char c[]={‘1‘,‘1‘,‘5‘,‘9‘};
      String s=String.valueOf(c);

Java基礎知識整理(一)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.