tailieunhanh - Object Oriented Programming - Lesson 9: Utility classes and collections

Object Oriented Programming - Lesson 9: Utility classes and collections includes String and StringBuffer, Collections Framework (Collections Interface, ArrayList Class, HashSet Class, HashMap Class), Iterator and Comparator Interface. | LESSON IX. Utility classes and collections Trinh Thanh TRUNG (MSc) trungtt@ Objectives • After this lesson, students can: – Understand the meanings of Wrapper class as well as its main purpose of conversion – Learn how to use mathematic constants and functions – Differentiate between String and StringBuffer and use appropriately – Understand Java Collection Framework and work with Set, List, Map data structure. – Understand the relations between Java Colllection and Iterator and Comparator Content • I. String and StringBuffer • II. Collections Framework – – – – Collections Interface ArrayList Class HashSet Class HashMap Class • III. Iterator and Comparator Interface I. String and StringBuffer StringBuffer is faster than String in concatenation (1/2) • StringBuffer is faster than String when performing simple concatenations – Ex1: String str = new String ("First "); str += "Second"; – Ex2: StringBuffer str = new StringBuffer ("First .

TÀI LIỆU MỚI ĐĂNG
11    156    2    02-12-2024
309    135    0    02-12-2024