Computer Science 1027A/B Study Guide - James Gosling, Sun Microsystems, Pariah Dog

33 views1 pages

Document Summary

Primitive types store actual objects in memory. Any type of object can be stored in an array (primitive or reference type) All items/elements in an array have the same type. // creating and and initializing an array of 5 elements int[] numbers = new int[3]; numbers[0] = 10; numbers[1] = 20; numbers[2] = 30; // creating a 2x3 array (two rows, three columns) int[2][3] matrix = new int[2][3]; matrix[0][0] = 10; Cannot add or remove new items once you instantiate an array. New items or remove existing items, with collection classes. Array class int[] numbers = { 4, 2, 7 }; Java was developed by james gosling in 1995 at. Scanner scanner = new scanner(system. in); double number = scanner. nextdouble(); int number = scanner. nextint(); Useful string methods strings are immutable, which means once we initialize them, their value cannot be changed. All methods that modify a string (like touppercase) return a new string object.

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

Related Documents

Related Questions