Computer Science 1026A/B Chapter Notes -Railways Act 1921
terubarenuka and 39895 others unlocked
26
COMPSCI 1026A/B Full Course Notes
Verified Note
26 documents
Document Summary
Picture: a grid or matrix of pixels: the grid has columns and rows shown with (x,y) position in the grid. Creating a picture object: string filename = filechooser. pickafile(), picture pictureobj = new picture(filename); A picture is a grid or matrix of pixels. The grid has columns and rows, each with an (x,y) position in the grid. A picture object can be created by: string filename = filechooser. pickafile(), picture pictureobj = new picture(filename); A picture object has properties width and height (measured in pixels": picture width: pictureobj. getwidth(), picture height: pictureobj. getheight(); Array: storage for a collection of items of the same type. It is possible to access individual items by using an index. It is possible to access individual items by using an index: the index starts at 0, the last item is at index (length - 1) In java, arrays behave like objects: we need to declare a reference variable, we need to create the array object.