User Input, Exceptions, and Reading and Writing Text Files
User Input, Exceptions, and Reading and Writing Text Files
15-121 Fall 2020 Margaret Reid-Miller
Today
? Homework3: is available ? due Monday September 21th at 11:55pm
? From last time: Encapsulation ? Reading User Input ? Handling exceptions ? Reading a text file ? Writing to a text file
Fall 2020
15-121 (Reid-Miller)
2
Writing classes
What 3 things may appear inside a class?
fields constructors methods What should I determine first?
the fields Think: "What does my object need to remember?"
How do you declare a field?
_p_r_iv_a_t_e_ ____ _____; type name
Fall 2020
15-121 (Reid-Miller)
3
Inside a constructor or non-static method, what variables does it have access to?
1. local variables declared inside the method 2. parameters 3. fields
In a static method, we cannot access __fie_l_d_s__.
(or anything that isn't static without creating an object first)
What are Java's visibility modifiers?
Fall 2020
15-121 (Reid-Miller)
4
Classes (and their parts) have visibility modifiers:
? public: accessible to everyone ? protected: inside package, inside class,
inside subclass ? package-private (default, no modifier used):
inside package, inside class ? private: accessible only within the class
Fall 2020
15-121 (Reid-Miller)
5
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- ece 304 running a net list file in ps
- lesson 7 if statement and comparison operators pace university new york
- 3 consider the following fragment of javascript give the output that
- chapter 15 javascript 4 objects and arrays university of cape town
- practice more javascript a level it 9626 mrsaem
- chapter 16 javascript 3 functions university of cape town
- statistical software for data science stata
- littlefs stensat
- cs106a stanford handout 53 fall 2003 04 nick parlante files
- 17csl77 web technology lab with mini project atria
Related searches
- reading and writing games for 4th graders
- 2nd grade reading and writing worksheets free
- reading and writing statistics
- reading and writing worksheets
- 2nd grade reading and writing worksheet
- free reading and writing websites
- free reading and writing worksheets
- 4th grade reading and writing worksheets
- free reading and writing printable worksheets
- esl reading and writing practice
- reading and writing placement test
- reading and writing skills