CS-1101 Lecture 6: Chapter 6
66 views2 pages
11 Aug 2016
School
Department
Course
Professor
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
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers