CS-1101 Lecture 6: Chapter 6

66 views2 pages

Document Summary

Printstream: an object in the java. io package that lets you print output to a destination such as file. Any methods used with system. out will work on a print stream object: printstream name = new printstream(new file ( file name )); Do not open the same file for both reading (scanner) and writing (printstream) at the same time. Array: starts out with all zeroes all data in an array must be of the same type. Create: ex: double [] temperature = new double[7] Makes an array with 7 spots numbered 0-6. Variables (or elements) can be used as whatever type they were declared as. Integer in square brackets is called the index. Base type can be any type including class. Number. length has no parentheses with arrays because only length with methods needs parameters. Arrays are fields and therefore finds the location of length within. Length 1 is actual index of the array.

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