官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 大港区| 新化县| 涟水县| 开封县| 光泽县| 定州市| 松江区| 泸水县| 拜泉县| 阳谷县| 南丹县| 嫩江县| 苍梧县| 苏尼特左旗| 义乌市| 盐城市| 固始县| 开鲁县| 厦门市| 嵊泗县| 宁蒗| 枣庄市| 健康| 潞西市| 新安县| 昭通市| 平和县| 阿合奇县| 黄冈市| 中西区| 且末县| 宜阳县| 宁南县| 连山| 莱州市| 双流县| 金阳县| 定边县| 彭阳县| 渭源县| 浏阳市|