Đang chuẩn bị liên kết để tải về tài liệu:
Lập trình Java cơ bản : Collections part 10

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

Đa nhiệm (multitasking) • Hai kỹ thuật đa nhiệm cơ bản • Đa tiến trình (Process-based multitasking): Nhiều chương trình được xử lý cùng một lúc | Ví dụ 3 HashMap This program stores a phone directory by hashing import java.util. public class MyMapTest public static void main String args Map phoneDir new HashMap phoneDir.put 5581814 new String Dept. Informatics phoneDir.put 8584490 new String Defense Staff phoneDir.put 8587346 new String Administrative Staff phoneDir.put 7290028 new String Student Club print all entries System.out.println phoneDir remove an entry phoneDir.remove 8584490 55 Ví dụ 3 HashMap replace an entry phoneDir.put 7290028 new String International Relation look up a value System.out.println phoneDir.get 5581814 iterate through all entries Set entries phoneDir.entrySet Iterator iter entries.iterator while iter.hasNext Map.Entry entry Map.Entry iter.next String key String entry.getKey String value String entry.getValue System.out.println key key value value 56 Các lớp bao Collection chỉ làm việc trên các Object. Những kiểu dữ liệu cơ bản như byte short int long double float char boolean không thể đưa được trực tiếp vào Collection mà phải thông qua các lớp bao. Các lớp bao Byte Short Int Long Double Float Char Boolean. Ví dụ Integer intObject new Integer 9 int value intObject.intValue .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.