- 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.
推薦閱讀
- C++案例趣學
- Mastering C# Concurrency
- 3D少兒游戲編程(原書第2版)
- 深入淺出Serverless:技術原理與應用實踐
- 快人一步:系統性能提高之道
- JavaScript應用開發實踐指南
- MyBatis 3源碼深度解析
- Vue.js光速入門及企業項目開發實戰
- Flask Web開發:基于Python的Web應用開發實戰(第2版)
- Xamarin Cross-Platform Development Cookbook
- Oracle Database XE 11gR2 Jump Start Guide
- Android技術內幕(系統卷)
- Python深度學習(第2版)
- Processing開發實戰
- MySQL核心技術與最佳實踐