Variables and Data Types

来源:百度知道 编辑:UC知道 时间:2024/07/08 18:54:35
麻烦各位专业人事忙帮翻译一下,我有急用,谢谢您的好心帮助

Variables are locations in memory in which values can be stored. They have a name, a type, and a value. Before you can use a variable, you have to declare it. After it is declared, you can then assign values to it.
Java actually has three kinds of variables: instance variables, class variables, and local variables. Instance variables, as you learned yesterday, are used to define attributes or the state for a particular object. Class variables are similar to instance variables, except heir values apply to all that class’s instances (and to the class itself) rather than having different values for each object.
Local variables are declared and used inside method definitions, for example, for index counters in loops, as temporary variables, or to hold values that you need only inside the method definition itself. They can also be used inside blocks ({}), which you’ll learn about later this week. Once the method (or block) finishes executing

变量地址在记忆中的价值观可以被保存。他们有一个名称,种类,以及它的价值。之前,你可以用一个变量时,你要申报。之后,它宣称,然后你可以赋值给它。
JAVA其实有三种变量:实例变量级变量,局部变量。比如变数,因为你了解,昨天,是用来界定属性或国家为特定对象。一流的变量是相似的实例变量,除非继承人值可适用于所有阶级的实例(和阶级本身) ,而不是具有不同的价值观,为每个对象。
局部变量是申报和使用方法里面定义,例如,对于指数柜台,在循环中,作为临时变量,或持有价值,你只需要在该方法定义本身。也可以被用来里面块({}),而这里了解一下本星期晚些时候。一旦方法(或块)的成绩执行,变量的定义和它的价值不再存在。使用局部变量的存储信息的需要,由一个单一的方法与实例变量来存储信息,需要通过多种方法,在对象上的操作。
虽然所有三种变数宣布,在许多相同的方法,阶级和的实例变量是获取和分配,在略有不同的方式,从当地的变数。今天,你将重点放在变量使用的方法定义;明天,你将学习如何处理,例如与阶级的变数。

爱莫能助!~!