楼主: wwqqer
4918 52

[投资学] 【程序软件系列】Java Programming 第八版 [推广有奖]

41
Lisrelchen 发表于 2017-2-12 06:28:51
  1. public class DemoArray
  2. {
  3. public static void main(String[] args)
  4. {
  5. 2. On a new line, declare and create an array that can hold four double values
  6. by typing the following:
  7. double[] salaries = new double[4];
  8. 3. One by one, assign four values to the four array elements by typing the
  9. following:
  10. salaries[0] = 6.25;
  11. salaries[1] = 6.55;
  12. salaries[2] = 10.25;
  13. salaries[3] = 16.85;
  14. 4. To confirm that the four values have been assigned, display the salaries one
  15. by one using the following code:
  16. System.out.println("Salaries one by one are:");
  17. System.out.println(salaries[0]);
  18. System.out.println(salaries[1]);
  19. System.out.println(salaries[2]);
  20. System.out.println(salaries[3]);
  21. 5. Add the two closing curly braces that end the main() method and the
  22. DemoArray class.
  23. 6. Save the program as DemoArray.java. Compile and run the program.
  24. The program’s output appears in Figure 8-2.
复制代码

42
baconshen 发表于 2017-2-12 12:25:01
Java Programming 第八版

43
keeyingsum 发表于 2017-2-12 13:08:54
thanks a lot

44
xixinquyu2 发表于 2017-2-20 23:53:50
great book

45
tcca6675 发表于 2017-2-22 09:07:14
thanks for your sharing

46
=.=LoUiS---- 发表于 2017-2-22 12:11:40
thanks a lot

47
kiw9761 发表于 2017-2-27 17:08:29
谢谢分享

48
ruimizu 发表于 2017-2-27 20:12:48
!!!!!!!!!!!!!!

49
志在旋风 发表于 2018-5-22 18:48:44
谢谢分享

50
志在旋风 发表于 2018-5-22 18:48:44
谢谢分享

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jr
拉您进交流群
GMT+8, 2026-1-8 13:39