Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Giới thiệu
Đăng ký
Đăng nhập
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Kỹ thuật lập trình
Lecture Introduction to programming with Java - Chapter 14: Exception handling
tailieunhanh - Lecture Introduction to programming with Java - Chapter 14: Exception handling
This chapter presents the following content: Using try and catch blocks to handle "Dangerous" method calls, numberformatexception, line plot example, try and catch blocks - more details, two types of exceptions - checked and unchecked, unchecked exceptions, checked exceptions,.and other contents. | Chapter 14 - Exception Handling Using try and catch Blocks to Handle "Dangerous" Method Calls NumberFormatException Line Plot Example try and catch Blocks - More Details Two Types of Exceptions - Checked and Unchecked Unchecked Exceptions Checked Exceptions Using API Documentation when Writing Exception-Handling Code When a try Block Throws Different Types of Exceptions The Exception Class and its getMessage Method Multiple catch blocks Understanding Exception Messages 1 Using try and catch Blocks to Handle "Dangerous" Method Calls Some API method calls are "dangerous" in that they might possibly lead to a runtime error. Example of a "safe" API method call (no runtime error possible): () Example of an API method call that might lead to a runtime error: () Technique for handling such runtime errors: Use exception handling. More specifically, surround the method call with a try block and insert a catch block immediately after the try block. 2 Using try and catch Blocks to Handle "Dangerous" Method Calls Syntax for try and catch blocks: try { } catch ( ) { } Example try and catch code fragment: try { quantity = (userEntry); } catch (NumberFormatException nfe) { ("Invalid quantity entered." + " Must be a whole number."); } Normally, one or more of these statements will be a "dangerous" API method call or constructor call. The exception class should match the type of exception that the try block might throw. 3 Using try and catch Blocks to Handle "Dangerous" Method Calls Semantics for previous slide's try and catch code fragment: If the userEntry string contains all digits, then: The int version of userEntry is assigned into quantity. The JVM skips the catch block and continues below it. If the userEntry string does not contain all digits, then: The parseInt method throws a NumberFormatException object. The | Chapter 14 - Exception Handling Using try and catch Blocks to Handle "Dangerous" Method Calls NumberFormatException Line Plot Example try and catch Blocks - More Details Two Types of Exceptions - Checked and Unchecked Unchecked Exceptions Checked Exceptions Using API Documentation when Writing Exception-Handling Code When a try Block Throws Different Types of Exceptions The Exception Class and its getMessage Method Multiple catch blocks Understanding Exception Messages 1 Using try and catch Blocks to Handle "Dangerous" Method Calls Some API method calls are "dangerous" in that they might possibly lead to a runtime error. Example of a "safe" API method call (no runtime error possible): () Example of an API method call that might lead to a runtime error: () Technique for handling such runtime errors: Use exception handling. More specifically, surround the method call with a try block and insert a catch block immediately after the
Mạnh Thiện
81
36
ppt
Báo lỗi
Trùng lắp nội dung
Văn hóa đồi trụy
Phản động
Bản quyền
File lỗi
Khác
Upload
Tải xuống
đang nạp các trang xem trước
Không thể tạo bản xem trước, hãy bấm tải xuống
Tải xuống
TÀI LIỆU LIÊN QUAN
Java Network Programming, 3rd Edition
3596
130
0
Java Cookbook, 2nd Edition
1
129
0
Java Thread Programming
1
121
0
Java All-In-One Desk Reference for Dummies bydoug loweandbarry burd
1
95
0
Java Enterprise in a Nutshell, 3rd Edition
1
109
0
The Java programming experience
59
137
0
Adavanced Java networking
363
90
0
Java programming experience
30
104
0
Learning Wireless Java By Qusay Mahmoud
1
87
0
Examplets from The Java Developers Almanac 2000
364
92
0
TÀI LIỆU XEM NHIỀU
Một Case Về Hematology (1)
8
461890
55
Giới thiệu :Lập trình mã nguồn mở
14
22748
61
Tiểu luận: Tư tưởng Hồ Chí Minh về xây dựng nhà nước trong sạch vững mạnh
13
10915
531
Câu hỏi và đáp án bài tập tình huống Quản trị học
14
10094
447
Phân tích và làm rõ ý kiến sau: “Bài thơ Tự tình II vừa nói lên bi kịch duyên phận vừa cho thấy khát vọng sống, khát vọng hạnh phúc của Hồ Xuân Hương”
3
9543
104
Ebook Facts and Figures – Basic reading practice: Phần 1 – Đặng Tuấn Anh (Dịch)
249
8310
1127
Tiểu luận: Nội dung tư tưởng Hồ Chí Minh về đạo đức
16
8252
423
Mẫu đơn thông tin ứng viên ngân hàng VIB
8
7869
2221
Đề tài: Dự án kinh doanh thời trang quần áo nữ
17
6716
253
Giáo trình Tư tưởng Hồ Chí Minh - Mạch Quang Thắng (Dành cho bậc ĐH - Không chuyên ngành Lý luận chính trị)
152
5833
1413
TỪ KHÓA LIÊN QUAN
Kỹ thuật lập trình
Programming with Java
Programming language
Java programming language
Java programs
Programming language code
Exception handling
java programming
java programming experience
technical java programming
java programming tutorial
java programming document
Java Network Programming
java programming theory
Java Cookbook
Java Thread Programming
Java
Adavanced Java networking
java programming theor
Learning Wireless Java
java programming theo
Java basics
Elementary programming
Declaring variables
Event driven programming
Event classes
Object oriented programming
Central processing unit
Output devices
Java coordinate system
Graphics class
Hardware terminology
TÀI LIỆU MỚI ĐĂNG
Giáo án mầm non chương trình đổi mới: Gia đình vui nhộn
4
313
1
03-05-2024
TƯƠNG QUAN GIỮA MÔ HỌC, GIẢI PHẪU VÀ HÌNH ẢNH CỦA CÁC KHỐI U PHẦN PHỤ
3
169
0
03-05-2024
B2B Content Marketing: 2012 Benchmarks, Budgets & Trends
17
140
0
03-05-2024
Diseases of the Liver and Biliary System - part 1
33
125
0
03-05-2024
XỬ TRÍ CHẤN THƯƠNG SỌ NÃO KÍN
1
116
1
03-05-2024
Hệ thống làm lạnh và điều hòa không khí
21
128
0
03-05-2024
Fecal Incontinence Diagnosis and Treatment - part 8
35
103
0
03-05-2024
Báo cáo nghiên cứu nông nghiệp " Biofertiliser inoculant technology for the growth of rice in Vietnam: Developing technical infrastructure for quality assurance and village production for farmers "
12
89
0
03-05-2024
Quy Trình Canh Tác Cây Bông Vải
8
110
0
03-05-2024
Báo cáo khoa học: " Principaux critères économiques de gestion des forêts : analyse critique et comparative"
29
89
0
03-05-2024
TÀI LIỆU HOT
Mẫu đơn thông tin ứng viên ngân hàng VIB
8
7869
2221
Giáo trình Tư tưởng Hồ Chí Minh - Mạch Quang Thắng (Dành cho bậc ĐH - Không chuyên ngành Lý luận chính trị)
152
5833
1413
Ebook Chào con ba mẹ đã sẵn sàng
112
3773
1234
Ebook Tuyển tập đề bài và bài văn nghị luận xã hội: Phần 1
62
5339
1136
Ebook Facts and Figures – Basic reading practice: Phần 1 – Đặng Tuấn Anh (Dịch)
249
8310
1127
Giáo trình Văn hóa kinh doanh - PGS.TS. Dương Thị Liễu
561
3522
645
Tiểu luận: Tư tưởng Hồ Chí Minh về xây dựng nhà nước trong sạch vững mạnh
13
10915
531
Giáo trình Sinh lí học trẻ em: Phần 1 - TS Lê Thanh Vân
122
3698
525
Giáo trình Pháp luật đại cương: Phần 1 - NXB ĐH Sư Phạm
274
4080
517
Bài tập nhóm quản lý dự án: Dự án xây dựng quán cafe
35
4140
480
crossorigin="anonymous">
Đã 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.