正在加载图片...
上海交通大学交大密西根 联合学院 81 UM-SJTU Joint Institute University of Michigan Shanghal Jiao Tong University Object Definition General syntax: Modifier class/type object/var initial value Examples: AddIntConsoleT console; int int1,int2,intSum=0; All objects/variables sharing the same class/type will have the similar property defined in that class/type. The first line defined an object of class AddIntConsoleT(ype)and the second line defined 3 integer variables You can also initialize a variable while you declare it like intSum 0;Object Definition Object Definition • General syntax: – Modifier class/type object/var = initial value – Examples: • AddIntConsoleT console; • int int1, int2, intSum = 0; • All objects/variables sharing the same class/type will have the similar property defined in that class/type. • The first line defined an object of class AddIntConsoleT(ype) and the second line defined 3 integer variables • You can also initialize a variable while you declare it like intSum = 0;
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有