- Java 9 Programming By Example
- Peter Verhas
- 117字
- 2021-07-02 23:37:33
Variables
In Java, just like in almost any programming language, we use variables. The variables in Java are typed. It means that a variable can hold a value of a single type. It is not possible for a variable to hold an int type at some point in the program and later a String type. When variables are declared, their type is written in front of the variable name.
Variables also have visibility scope. Local variables in methods can only be used inside the block in which they are defined. A variable can be used inside methods or they can belong to a class or an object. To differentiate the two, we usually call these variables fields.
推薦閱讀
- Spring 5.0 Microservices(Second Edition)
- LaTeX Cookbook
- Design Principles for Process:driven Architectures Using Oracle BPM and SOA Suite 12c
- Building a Game with Unity and Blender
- Visual Basic編程:從基礎(chǔ)到實(shí)踐(第2版)
- 程序員面試算法寶典
- R語言編程指南
- Java EE 7 Development with NetBeans 8
- Visual Basic程序設(shè)計(jì)與應(yīng)用實(shí)踐教程
- Windows Phone 7.5:Building Location-aware Applications
- Java零基礎(chǔ)實(shí)戰(zhàn)
- 零基礎(chǔ)學(xué)C語言程序設(shè)計(jì)
- Android智能手機(jī)APP界面設(shè)計(jì)實(shí)戰(zhàn)教程
- 啊哈C語言!:邏輯的挑戰(zhàn)(修訂版)
- Mastering ArcGIS Server Development with JavaScript