Inheritance (Discussion 4) (Kế thừa trong Java) - Christine Zhou
- 페이지 수
- 27
- 형식
- PPTX
- 크기
- 1 MB
- Trường
- University of California, Berkeley
- 조회수
- 0
- 댓글
- 0
- Lượt tải
- 0
미리보기 생성 중...
Tài liệu hướng dẫn buổi thảo luận số 4 về kế thừa trong Java, bao gồm ôn tập kế thừa, kiểm thử JUnit và các bài tập thực hành.
- 문서명
- Inheritance (Discussion 4) (Kế thừa trong Java) - Christine Zhou
- 학교 / 강의
- University of California, Berkeley · Lập trình Java
- 내용
- Tài liệu thảo luận về kế thừa trong Java, bao gồm kiểm thử JUnit, cú pháp 'extends' và 'implements', cũng như sự khác biệt giữa kiểu tĩnh và động. Nội dung được trình bày qua các vấn đề, bài giảng nhỏ và ví dụ minh họa.
- 목차
- Discussion 4: Inheritance
- Disclaimer
- Agenda
- Administrivia
- JUnit Testing
- Review: Inheritance
- Inheritance: extends
- Review: Inheritance
- Creating Cats
- Creating Cats
- Review: More Inheritance
- Inheritance: implements
- Review: Static vs. Dynamic Types
- Overriding/Overloading
- 페이지 수
- 27 페이지
- 업로더
- Uni24h
설명
Trích nội dung tài liệu
Discussion 4: Inheritance Disclaimer There will be a lot of “Java rules” for the next week or so; bear with us! Agenda Problem 1 Mini lecture and Problem 2 Mini lecture and Problem 3 Problem 4 at your own pace Administrivia Project 1B and 1Gold released, due Saturday 2/16 Lab this week is peer-code review; attendance is required! Midterm 2/20, 8-10 PM, see midterm post for more details Room assignments out later on Guerrilla section this Sunday 2/17 from 2-4pm in 271, 273, 275 Soda One-on-one tutoring sign ups on Piazza weekly Resources: tinyurl.com/cz-disc4-sp19 Resources: tinyurl.com/cs61b-christine-zhou JUnit Testing What are the advantages and disadvantages of writing JUnit tests? Advantages: 1. Organized code - each test corresponds to different part of program 2. Can debug code locally 3. Documentation that your program works 4. Can reduce the amount of test code you need to write because you can reuse code Disadvantages: 1. Hard to use for higher-level testing (integration testing) Review: Inheritance public class Fish { String name; public Fish(String name) {...} public class Goldfish { String name; public Goldfish(String name) {...} Public void eat() {...} public void blink() {...} public void eat() { print(“bloop”); ... } } public void blink() {...} } Inheritance: extends extends (can extend only one class) Inherits all fields, methods, and nested classes Constructor is not inherited, but there will be an implicit call to super( ) in the beginning of the subclass’s constructor (need to make the Superclass before making the Subclass) If the Superclass’s constructor requires arguments, you must write an explicit call to super! Fish() { Goldfish() { this.name = “Bob”; super(); this.age = 12; this.name = “Bobfish”; } } Fish(String name) { Goldfish(String name) { this.name = name; super(name); this.age = 12; this.name
자주 묻는 질문
이 문서는 무료인가요?
네. “Inheritance (Discussion 4) (Kế thừa trong Java) - Christine Zhou” 문서는 무료입니다. 로그인 후 '다운로드'를 클릭하여 원본 파일을 받으세요.
이 문서는 몇 페이지로 되어 있나요?
이 문서는 27페이지입니다, Lập trình Java 과정용. 다운로드하기 전에 온라인으로 미리 볼 수 있습니다.
다운로드하기 전에 미리 볼 수 있나요?
네. 이 페이지의 온라인 리더를 통해 문서를 미리 본 후 다운로드 여부를 결정할 수 있습니다.
Inheritance (Discussion 4) (Kế thừa trong Java) - Christine Zhou
미리보기 생성 중...
Trích nội dung tài liệu
Discussion 4: Inheritance Disclaimer There will be a lot of “Java rules” for the next week or so; bear with us! Agenda Problem 1 Mini lecture and Problem 2 Mini lecture and Problem 3 Problem 4 at your own pace Administrivia Project 1B and 1Gold released, due Saturday 2/16 Lab this week is peer-code review; attendance is required! Midterm 2/20, 8-10 PM, see midterm post for more details Room assignments out later on Guerrilla section this Sunday 2/17 from 2-4pm in 271, 273, 275 Soda One-on-one tutoring sign ups on Piazza weekly Resources: tinyurl.com/cz-disc4-sp19 Resources: tinyurl.com/cs61b-christine-zhou JUnit Testing What are the advantages and disadvantages of writing JUnit tests? Advantages: 1. Organized code - each test corresponds to different part of program 2. Can debug code locally 3. Documentation that your program works 4. Can reduce the amount of test code you need to write because you can reuse code Disadvantages: 1. Hard to use for higher-level testing (integration testing) Review: Inheritance public class Fish { String name; public Fish(String name) {...} public class Goldfish { String name; public Goldfish(String name) {...} Public void eat() {...} public void blink() {...} public void eat() { print(“bloop”); ... } } public void blink() {...} } Inheritance: extends extends (can extend only one class) Inherits all fields, methods, and nested classes Constructor is not inherited, but there will be an implicit call to super( ) in the beginning of the subclass’s constructor (need to make the Superclass before making the Subclass) If the Superclass’s constructor requires arguments, you must write an explicit call to super! Fish() { Goldfish() { this.name = “Bob”; super(); this.age = 12; this.name = “Bobfish”; } } Fish(String name) { Goldfish(String name) { this.name = name; super(name); this.age = 12; this.name
- 문서명
- Inheritance (Discussion 4) (Kế thừa trong Java) - Christine Zhou
- 학교 / 강의
- University of California, Berkeley · Lập trình Java
- 내용
- Tài liệu thảo luận về kế thừa trong Java, bao gồm kiểm thử JUnit, cú pháp 'extends' và 'implements', cũng như sự khác biệt giữa kiểu tĩnh và động. Nội dung được trình bày qua các vấn đề, bài giảng nhỏ và ví dụ minh họa.
- 목차
- Discussion 4: Inheritance
- Disclaimer
- Agenda
- Administrivia
- JUnit Testing
- Review: Inheritance
- Inheritance: extends
- Review: Inheritance
- Creating Cats
- Creating Cats
- Review: More Inheritance
- Inheritance: implements
- Review: Static vs. Dynamic Types
- Overriding/Overloading
- 페이지 수
- 27 페이지
- 업로더
- Uni24h
댓글 (0)
댓글이 없습니다. 첫 댓글을 남겨보세요!
Java DataBase Connectivity - Kết nối kho dữ liệu Java
Ôn tập lập trình Java (MT2 Review Solutions) - Ching and Christines
Asymptotics II, Search Trees (Discussion 7) (Kỹ thuật phân tích thời gian chạy, cây tìm kiếm nhị phân) - Christine Zhou
Introduction to Java (Discussion 1) (Giới thiệu về Java) - Christine Zhou
Giáo trình Lập trình Java
Tổng hợp Đề Toán 5 - Luyện thi vào Lớp 6 - CLB EMath
Bài giảng vật lý đại cương (Chương 3) - Đỗ Ngọc Uấn
Chương 8.Nguyên tử - Vật lý đại cương 3 - TS.Nguyễn Thị Trang
Chương 7.Cơ học lượng tử - Vật lý đại cương 3 - TS.Nguyễn Thị Trang
Chương 6.Quang học lượng tử - Vật lý đại cương 3 - TS.Nguyễn Thị Trang

댓글 (0)
댓글이 없습니다. 첫 댓글을 남겨보세요!