ITM 200 Chapter Notes - Chapter 4: Dialog Box, String Literal

38 views1 pages

Document Summary

Variables are int, char and double these are pigeon holes" in the computer"s memory into which you can place literal values which are integers and characters and floating point numbers; these are called primitive types variables. String class from the java standard library is used for this purpose. In order to be useful variable must be created to reference a string object. Notice the s in string is upper case, as we already know class name should always begin with a upper case. String variables are an example of so called reference variables. Reference variables does not actually contain its associated data, but contains a reference to the data. You can represent the reference as an arrow, pointing to the data. Primitive variables contain the value that they have been assigned (example: number 25) The value 25 will be stored in the memory location associated as variable number. Objects are not stored under variables but they are referenced by variables.