CPSC-1060 Lecture Notes - Lecture 2: Pariah Dog, Dollar Sign, Uninitialized Variable

43 views5 pages

Document Summary

Cpsc 1060 lecture 2: basic computation part 1. Variables: store data such as numbers and letters. Think of them as places to store data: value. The value is stored in the memory location: the value can be changed. Ex. (variable_1) is a generic variable called a syntactic variable int stylechoice, numberofchecks; Where to declare variables: declare a variable . At the beginning of the section of the program that is enclosed in {} Public static void main(string[] args): /* declare variables here*/ Where expression can be another variable, a literal or constant (such as a number), or something more complicated which combines variables and literals using various operators (such as + and -) Used for simple, non-decomposable values such as an individual number or individual character int, double, and char are primitive types: class/object type. Used for a class or objects and has both data and methods. Java is fun is a value of class type string.

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
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents