Scope, Pass by Value, Static (Discussion 2) (Phạm vi, truyền tham trị và từ khóa static trong Java) - Christine Zhou
- ページ数
- 15
- 形式
- PPTX
- サイズ
- 700 KB
- Trường
- University of California, Berkeley
- 閲覧数
- 0
- コメント
- 0
- Lượt tải
- 0
プレビューを生成中...
Tài liệu thảo luận về phạm vi, truyền tham trị và từ khóa static trong Java, kèm ôn tập danh sách liên kết và sơ đồ box-and-pointer.
- ドキュメント名
- Scope, Pass by Value, Static (Discussion 2) (Phạm vi, truyền tham trị và từ khóa static trong Java) - Christine Zhou
- 学校 / コース
- University of California, Berkeley · Lập trình Java
- 内容
- Tài liệu thảo luận về phạm vi, truyền tham trị và các thành phần tĩnh trong Java, kèm theo các ví dụ và bài tập thực hành về định nghĩa lớp, kiểu dữ liệu và cấu trúc dữ liệu IntList.
- 目次
- Agenda
- Announcements
- Administrivia
- Review: Defining classes
- Review: Java’s Types
- Review: Box and Pointer Diagrams
- Java is pass by value
- 1) Pass by What?
- Review: Static Variables/Methods
- 2) Static Methods and Variables
- Review: IntLists
- 3) Practice with Linked Lists
- 4) Extra: Squaring a List
- ページ数
- 15 ページ
- アップロード者
- Uni24h
説明
Trích nội dung tài liệu
Discussion 2: Scope, Pass-byValue, Static Christine Zhou Agenda Announcements Worksheet #1 Worksheet #2 Worksheet #3 (if we can!) Administrivia Lab 1 and Lab 2 due this Friday 2/1 at midnight. ○ Note, all labs are due Friday at midnight the week they are assigned. Proj0 NBody also due Friday at midnight. ○ If you haven’t started please start ASAP! Office hours and exam prep/LOST sections start this week! See calendars on the course website. Pre-semester Advising: @414 or email me! Discussion survey: http://tinyurl.com/cz-disc2-sp19 ○ Good for me to collect your emails (in case I have announcements or mess up during discussion 😅) Review: Defining classes // class definition public class IntList { // instance variables int head; IntList tail; // constructors, which will create IntList objects public IntList() {...} public IntList(int value, IntList tail) {...} // you can create methods that use the instance variables! public void insert(int val) {...} public void removeLast() {...} } Review: Java’s Types Primitives: References: byte, short, long, int, double, float, char, boolean Everything else! Objects, arrays, Strings, etc. Review: Box and Pointer Diagrams Box and Pointers are the 61B equivalent of 61A’s environment diagram They are crucial to helping us keep track of what goes on in a program: use them! int x = 29; int x 29 Primitives go in the box int[] arr = new int[3]; We didn’t specify what integers are going in the array, so Java initializes it with the default value 0 int[ ] arr 0 0 0 Reference types are referenced via pointers Java is pass by value Golden Rule of Equals AKA pass-by-value When you do “a = b”, you always copy the bits (whatever is inside the box) of b into a. For primitives: Directly copy the value inside b to a. For Reference types: Copy the memory address of b into a. ○ Also can say “copies the pointer in b to a” int[ ] arr1 int x = 29; int y = x; int x int y 29 29 int[] arr1 = new int
よくある質問
このドキュメントは無料ですか?
はい。「Scope, Pass by Value, Static (Discussion 2) (Phạm vi, truyền tham trị và từ khóa static trong Java) - Christine Zhou」は無料です。ログインして「ダウンロード」をクリックするだけで、元のファイルを取得できます。
このドキュメントは何ページありますか?
このドキュメントは 15 ページあります(Lập trình Java コース用)。ダウンロードする前にオンラインでプレビューできます。
ダウンロードする前にプレビューできますか?
はい。このページにあるオンラインリーダーでドキュメントをプレビューし、その後ダウンロードするかどうかを決めることができます。
Scope, Pass by Value, Static (Discussion 2) (Phạm vi, truyền tham trị và từ khóa static trong Java) - Christine Zhou
プレビューを生成中...
Trích nội dung tài liệu
Discussion 2: Scope, Pass-byValue, Static Christine Zhou Agenda Announcements Worksheet #1 Worksheet #2 Worksheet #3 (if we can!) Administrivia Lab 1 and Lab 2 due this Friday 2/1 at midnight. ○ Note, all labs are due Friday at midnight the week they are assigned. Proj0 NBody also due Friday at midnight. ○ If you haven’t started please start ASAP! Office hours and exam prep/LOST sections start this week! See calendars on the course website. Pre-semester Advising: @414 or email me! Discussion survey: http://tinyurl.com/cz-disc2-sp19 ○ Good for me to collect your emails (in case I have announcements or mess up during discussion 😅) Review: Defining classes // class definition public class IntList { // instance variables int head; IntList tail; // constructors, which will create IntList objects public IntList() {...} public IntList(int value, IntList tail) {...} // you can create methods that use the instance variables! public void insert(int val) {...} public void removeLast() {...} } Review: Java’s Types Primitives: References: byte, short, long, int, double, float, char, boolean Everything else! Objects, arrays, Strings, etc. Review: Box and Pointer Diagrams Box and Pointers are the 61B equivalent of 61A’s environment diagram They are crucial to helping us keep track of what goes on in a program: use them! int x = 29; int x 29 Primitives go in the box int[] arr = new int[3]; We didn’t specify what integers are going in the array, so Java initializes it with the default value 0 int[ ] arr 0 0 0 Reference types are referenced via pointers Java is pass by value Golden Rule of Equals AKA pass-by-value When you do “a = b”, you always copy the bits (whatever is inside the box) of b into a. For primitives: Directly copy the value inside b to a. For Reference types: Copy the memory address of b into a. ○ Also can say “copies the pointer in b to a” int[ ] arr1 int x = 29; int y = x; int x int y 29 29 int[] arr1 = new int
- ドキュメント名
- Scope, Pass by Value, Static (Discussion 2) (Phạm vi, truyền tham trị và từ khóa static trong Java) - Christine Zhou
- 学校 / コース
- University of California, Berkeley · Lập trình Java
- 内容
- Tài liệu thảo luận về phạm vi, truyền tham trị và các thành phần tĩnh trong Java, kèm theo các ví dụ và bài tập thực hành về định nghĩa lớp, kiểu dữ liệu và cấu trúc dữ liệu IntList.
- 目次
- Agenda
- Announcements
- Administrivia
- Review: Defining classes
- Review: Java’s Types
- Review: Box and Pointer Diagrams
- Java is pass by value
- 1) Pass by What?
- Review: Static Variables/Methods
- 2) Static Methods and Variables
- Review: IntLists
- 3) Practice with Linked Lists
- 4) Extra: Squaring a List
- ページ数
- 15 ページ
- アップロード者
- 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)
まだコメントはありません。最初のコメントを書きましょう!