Java编程语言基础:实战指南第二部分

需积分: 0 2 下载量 124 浏览量 更新于2024-08-02 收藏 867KB PDF 举报
"Essentials of the JavaTM Programming Language: A Hands-On Guide, Part 2" 在《Java编程语言基础:实践指南,第二部分》中,作者Monica Pawlan深入介绍了Java技术的更多高级主题,旨在帮助开发者扩展他们在第一部分学习的基础知识。这部分教程和代码示例更具有挑战性,涵盖了网络通信、用户界面构建、数据加密解密、集合以及程序的国际化。 1. **网络通信(Socket Communications)** - **什么是套接字和线程?** 套接字是网络通信中的基本组件,它允许应用程序通过网络发送和接收数据。线程则是程序中的并发执行单元,使得程序可以同时处理多个任务。这部分将讲解如何在Java中创建和使用套接字进行网络通信,并涉及多线程编程以处理并发请求。 2. **用户界面(Building a User Interface)** - Java提供了丰富的组件库,如Swing和JavaFX,用于构建图形用户界面。这部分可能涵盖如何使用这些组件创建交互式的GUI,包括按钮、文本框、滚动条等,并讨论布局管理器如何帮助组织组件。 3. **数据加密与解密(Data Encryption and Decryption)** - 虽然这部分只提供了伪代码,但Java提供了一系列的加密API,如Java Cryptography Extension (JCE)和Java Cryptography Architecture (JCA),用于实现对数据的安全加密和解密。开发者会学习如何使用这些API来保护敏感信息。 4. **集合(Collections)** - 集合框架是Java中用于存储和操作一组对象的核心工具。这部分将介绍ArrayList、LinkedList、Set、Map等集合类型,以及迭代器、泛型等概念,帮助开发者有效地管理数据。 5. **程序的国际化(Internationalization of a Program)** - 国际化是指使软件能够适应不同地区的语言和文化习惯。Java提供了一套完整的i18n支持,包括资源包和Locale类。这部分将讲解如何创建可本地化的程序,以支持全球范围内的用户。 通过这部分的学习,读者将能够掌握更高级的Java编程技巧,包括网络编程、UI设计、安全性和数据管理,以及开发全球化应用的关键概念。这为进一步学习Java的高级特性,如多线程并发、分布式计算和企业级应用开发奠定了坚实的基础。

翻译 There are several reasons a network designed on layer-2 protocols is selected over a network designed on layer-3 protocols. In spite of the difficulties of using a bridge to perform the network role of a router, many vendors, customers, and service providers choose to use Ethernet in as many parts of their networks as possible. The benefits of selecting a layer-2 design are: Ethernet frames contain all the essentials for networking. These include, but are not limited to, globally unique source addresses, globally unique destination addresses, and error control. Ethernet frames can carry any kind of packet. Networking at layer-2 is independent of the layer-3 protocol. Adding more layers to the Ethernet frame only slows the networking process down. This is known as nodal processing delay. You can add adjunct networking features, for example class of service (CoS) or multicasting, to Ethernet as readily as IP networks. VLANs are an easy mechanism for isolating networks. Most information starts and ends inside Ethernet frames. Today this applies to data, voice, and video. The concept is that the network will benefit more from the advantages of Ethernet if the transfer of information from a source to a destination is in the form of Ethernet frames. Although it is not a substitute for IP networking, networking at layer-2 can be a powerful adjunct to IP networking. Layer-2 Ethernet usage has additional benefits over layer-3 IP network usage: Speed Reduced overhead of the IP hierarchy. No need to keep track of address configuration as systems move around. Whereas the simplicity of layer-2 protocols might work well in a data center with hundreds of physical machines, cloud data centers have the additional burden of needing to keep track of all virtual machine addresses and networks. In these data centers, it is not uncommon for one physical node to support 30-40 instances.

2023-07-23 上传