COMP 202 Lecture Notes - Lecture 30: While Loop
jc123 and 40170 others unlocked
100
COMP 202 Full Course Notes
Verified Note
100 documents
Document Summary
Comp 202 lecture 30 hashset and file reading. Java. util. hashmap: the keys in a hashmap are all unique and there cannot be any duplicates in the set of keys. Catching exceptions: in order to prevent your code from crashing at run time, you catch exceptions as follows o. The end but the error message as well. File i/o: this allows you to read to and write from a file. Ioexception: file io operations are so error prone that you are required to put them inside of a try-block and have a catch block for ioexception. Writing a file in java o: first create the file along with an object that can write to it, then create a buffer associated with that object. Reading from a file o: first create an object that reads from the file, this is an extremely error prone operation(typos) Filereader fr =new filereader(name): then create a buffer associated with the file.