前言
本文是橙子出于興趣愛好對Java官方教程的嘗試翻譯,幾乎每日更新,感興趣的朋友可以關注一下橙子;翻譯程序中盡可能多的對一些關鍵詞保留了英文原文,如果你想看最純正的英文原版教材卻又看不懂,可以試著來看一下橙子的翻譯版啊,歡迎大家留言討論,沖鴨!
更多相關文章點擊閱讀
Java官方教程(一)面向物件編程概念
Java官方教程(二-1)變數variable
Java官方教程(二-2)基本資料型別 Primitive Data Types
Java官方教程(二-3)陣列 Arrays
Java官方教程(二-4)變數小結 Summary of Variables
Java官方教程(三-1)運算子 operator
語言基礎
變數小結 Summary of Variables
Java語言的術語中同時使用了fields和variables,
- Instance variables (non-static fields) 對于每個類的實體都是唯一的,
- Class variables (static fields)是使用static修飾符declare的fields;無論class被實體化了多少次,class variable始終只有一個副本(copy),
- Local variables 存盤method內部的臨時狀態(temporary state),
- Parameters是為方法提供額外資訊的variables,
- Local variables and parameters總是被歸類為variables,而不是fields,
- 在命名fields and variables的時候,必須遵循規約,
8個基本資料型別是:byte, short, int, long, float, double, boolean, and char ,The java.lang.String 類代表字串(character strings),編譯器將為上述的fields分配一個合理的默認值,但永遠不會為區域變數分配默認值,Literals是代表固定值的原始碼,Arrays是一個包含固定數量單一型別值的容器物件,創建陣列的時候將確定其長度,創建之后,其長度不可變,
練一練
- The term “instance variable” is another name for ___.
- The term “class variable” is another name for ___.
- A local variable stores temporary state; it is declared inside a ___.
- A variable declared within the opening and closing parenthesis of a method signature is called a ____.
- What are the eight primitive data types supported by the Java programming language?
- Character strings are represented by the class ___.
- An ___ is a container object that holds a fixed number of values of a single type.
答案

年輕人不要不講武德,進來了點個贊再走啊!
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/236573.html
標籤:java
上一篇:JAVA實戰篇 Spring IOC實戰 利用Spring 集成MyBatis 創建所需要的Mapper物件
下一篇:Java八大基本資料型別
