深入理解Java:思维之旅

需积分: 10 1 下载量 162 浏览量 更新于2024-07-26 收藏 1.07MB PDF 举报
"《Think IN java》是一本深入探讨Java编程思想的书籍,作者Bruce Eckel是MindView, Inc.的总裁。这本书旨在帮助读者理解Java的强大之处,尤其是在解决复杂问题时的优势。书中强调了Java不仅仅是一系列特性的集合,而是需要在设计层面去理解和应用。通过构建一个知识结构模型,读者可以更深入地掌握Java语言,并能够运用它来解决问题。书中的章节围绕特定类型的编程问题展开,提供了挑战性的练习,并特别提到了关于Collections的精彩内容。这本书不仅适合初学者全面学习,也是经验丰富的开发者的重要参考书籍。读者反馈中,有人提到它对于通过Sun Certified Java Programmer考试有很大帮助,同时也称赞其深入浅出的示例和解释,认为它是学习Java的理想教材。" 《Think IN java》第四版深入介绍了Java编程的核心概念,鼓励读者不仅仅是从语法层面去学习Java,而是要理解其设计理念。书中提到,Java的强大在于其在面对复杂问题时的表达能力和灵活性。作者强调,不应孤立地看待Java的特性,而应将它们放在整体的设计框架下去理解。为了帮助读者更好地掌握这些概念,书中的每一章都会围绕一个特定的编程问题进行讲解,通过实例来展示Java如何解决这些问题。 此外,书中还强调建立一个“知识结构”模型的重要性。这个模型可以帮助读者在遇到困难时,将问题放入相应的位置,通过自我演绎找到答案。这种学习方法强调了主动思考和自我解决问题的能力,使学习过程更加高效。 书中的练习部分是提升技能的关键,它们设计得富有挑战性,旨在让读者在实践中深化理解。特别提到的“Collections”章节,可能涵盖了Java集合框架的深入探讨,包括List、Set、Map等接口及其实现类的使用,以及相关算法和数据结构的应用。 读者的评价反映了《Think IN java》的高质量和实用性,无论对于初学者还是有经验的开发者,这本书都提供了极高的价值。它被赞誉为编程教程的典范,以其完整的内容、精准的例子和严谨的解释赢得了高度认可,被认为是学习Java的必备读物。

Write java code: Copy the files, small_weapons.txt, and large_weapons.txt from the assignment folder on Blackboard and save them to your folder. For testing purposes, you should use the small file. Use the large file when you think the application works correctly. To see what is in the files use a text editor. Nilesh is currently enjoying the action RPG game Torchlight 2 which is an awesome game and totally blows Auction House Simulator 3, oh sorry, that should be Diablo 3, out of the water. He has got a file containing info on some of the unique weapons in the game. The transaction file contains the following information: Weapon Name (string) Weapon Type (string) Damage (int) Weapon Speed (double) … To tell if one weapon is better than another you need to know the Damage Per Second (DPS) the weapon does, since weapons have a different attack speed. DPS is calculated by taking the damage value and dividing it by the attack speed.a) You will write a program that will allow Nilesh to load the file and display the weapon info and DPS of every weapon in the input file. When the user chooses to open a weapon file, they are required to type in the filename. It will then read the 4 values about a particular weapon and then display the 4 values to the console window on one line neatly padded along with the DPS of the weapon. This is repeated until the end of the file. b) Modify your code from a) so that the weapon information written to the console window is also written to a text file. The user should be able to specify the name of the file. Add a header to the beginning of the file which has column headers for each column. At the end of the text file display the total number of weapons in the file. c) Document your code appropriately and add your name and id number as comments at the top of your code. Please also submit this text file you have created. Enter the file you want to search end with .txt: large_weapons.txt 1 Blackfang Bludgeon Great Hammer 489 1.44 339.58333333333337 2 Bones 2 Boneshredder Great Axe 256 0.84 304.76190476190476 3 Comet's Tail Great Sword 872 1.2 726.6666666666667 4 Decapitator Great Sword 188 1.08 174.07407407407408 5 Demolisher Great Hammer 887 1.32 671.9696969696969

170 浏览量