INSY 3433 Chapter Notes - Chapter 6: Reference Type, Pariah Dog, Exception Handling
Document Summary
Chapter 6: reference types are all nonprimitive types, primitive-type variable can hold exactly 1 value of its declared type @ a time, reference type variables store the addresses of objects in the computer"s memory. String[] x = new string[27]: square brackets can be placed either after variable type/after array variable name when only. Examples using arrays: can create an array & initialize its elements w/ an array initializer, ex: int [] n = {10, 20, 30, 40, 50}; Improves performance by eliminating the need to copy (possibly) large amounts of data: all arguments are passed by value in java, objects can"t be passed to methods. Using command-line arguments: possible to pass arguments form the command line to an app via main"s string[] parameter, command-line arguments separated by white space, not commas. Class arrays: class arrays provides static methods for common array manipulations & is imported using java. util. arrays.