数字赋值
在编程中处理数字是基础工作——从计数到计算价格都离不开它。现在请练习用真实数值声明并赋值数值型变量。
本练习是课程的一部分
Java 入门
练习说明
- 将
itemCount赋值为3425。 - 使用正确的原始类型声明变量
totalPrice,并赋值为11999.99。
交互式实操练习
通过完成这段示例代码来试试这个练习。
class NumericalDeclarations {
public static void main(String[] args) {
// Declare and assign variables
int itemCount = ____;
____ totalPrice ____ ____;
}
}