CSE 142 Chapter Notes - Chapter 16: Exception Handling

49 views3 pages
oliveherring648 and 18 others unlocked
CSE 142 Full Course Notes
32
CSE 142 Full Course Notes
Verified Note
32 documents

Document Summary

A file is a collection of information that is stored on a computer and assigned a particular name. A file name often ends with a special suffice that indicates the kind of data it contains. Files can be classified into text and binary files: text files can be edited using simple text editors. Often stored using . txt extension: binary files are stored using an internal format that requires special software. To access a file in java, you need to construct an internal object that represents the file: java class libraries include a class called file. You construct a file object by passing in the name of a file: file f = (cid:374)e(cid:449) file (cid:894)(cid:862)ha(cid:373)let. t(cid:454)t(cid:863)(cid:895); O(cid:374)(cid:272)e (cid:455)ou"(cid:448)e (cid:272)o(cid:374)stru(cid:272)ted the o(cid:271)je(cid:272)t, (cid:455)ou (cid:272)a(cid:374) (cid:272)all a (cid:374)u(cid:373)(cid:271)er of (cid:373)ethods to (cid:373)a(cid:374)ipulate the file. File class requires import from package java. io. Re(cid:373)e(cid:373)(cid:271)er that (cid:455)ou are(cid:374)"t a(cid:272)tuall(cid:455) (cid:272)o(cid:374)stru(cid:272)ti(cid:374)g the file (cid:271)(cid:455) (cid:272)o(cid:374)stru(cid:272)ti(cid:374)g the o(cid:271)je(cid:272)t. Scanner objects can be attached to many different kinds of input.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents