ACCTG 1 Lecture Notes - Lecture 5: Readwrite, Railways Act 1921, Cbuf-Fm

7 views11 pages
6 Sep 2020
School
Department
Course
Professor

Document Summary

Exception handling and streams lecture6 readfile() openfile(); determinefilesize(); allocatememory(); readfileintomemory closefile(); Calling method may forget to check for error code. Calling method may not know how to fix error. Exception: definition: an exception is an event that occurs during the execution of a program programming for failure that disrupts the normal flow of instructions. Advantages: separating error handling code from "regular" code, propagating errors up the call stack, grouping exceptions. The java language requires that methods either catch or specify all exceptions that can be thrown within the scope of that method!! Insufficientfundsexception ( ammount exceeds balance ); balance = balance amount; throw exception; Designing exception types example of exception handler in= new scanner(system. in); String inputline = in. next(); int age = integer. parseint(inputline); age++; Programs receive information from an external source or send out information to an external destination. A stream is an abstraction of a sequence of bytes.

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