- Java Data Analysis
- John R. Hubbard
- 126字
- 2021-07-02 18:21:44
Variables
In computer science, we think of a variable as a storage location that holds a data value. In Java, a variable is introduced by declaring it to have a specific type. For example, consider the following statement:
String lastName;
It declares the variable lastName
to have type String
.
We can also initialize a variable with an explicit value when it is declared, like this:
double temperature = 98.6;
Here, we would think of a storage location named temperature
that contains the value 98.6
and has type double
.
Structured variables can also be declared and initialized in the same statement:
int[] a = {88, 11, 44, 77, 22};
This declares the variable a
to have type int[]
(array of ints
) and contain the five elements specified.
推薦閱讀
- Objective-C應用開發(fā)全程實錄
- Visual Basic程序開發(fā)(學習筆記)
- Boost C++ Application Development Cookbook(Second Edition)
- 控糖控脂健康餐
- Production Ready OpenStack:Recipes for Successful Environments
- PostgreSQL 11從入門到精通(視頻教學版)
- Visual Basic程序設計實驗指導(第4版)
- PySide GUI Application Development(Second Edition)
- C語言程序設計
- Frank Kane's Taming Big Data with Apache Spark and Python
- C++從入門到精通(第6版)
- OpenCV with Python Blueprints
- LabVIEW數據采集
- Redmine Cookbook
- 深入理解Java虛擬機:JVM高級特性與最佳實踐