CS 161 Lecture Notes - Lecture 2: Instance Variable, Local Variable, 1.-Class Torpedo Boat

25 views2 pages
28 Aug 2016
School
Course

Document Summary

// instance variable private int x; private int y; public static void main(string[] args) { lectwo lt = new lectwo(); // local variables lt. x = 1; lt. y = 2; int x = 10; // "x" is used within a function. Scanner in = new scanner(system. in); int[] list = new int[9999]; int index = 0; while (in. hasnextline()) { String line = in. nextline(); line[index] = integer. parseint(line); index++; // shell(of the operating system) - a way to send commands to the operationg system. command operator. manages files at the terminal level. redirect input/output. // if file name doesnot exist, then exception occurs. try/catch blocks. // try/catch- safe way to read a file. read the string individually. // methods - function- allows to take a code block that will help solve large amounts of code. // unit testing- decompose the problem into pre/post conditions- in main.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions