Textbook Notes (381,128)
CA (168,362)
Ryerson (11,724)
ITM (869)
ITM 200 (25)
Chapter 3

Chapter 3

5 Pages
141 Views

Department
Information Technology Management
Course Code
ITM 200
Professor
Vikraman Baskaran

This preview shows pages 1-2. Sign up to view the full 5 pages of the document.
Chapter 3
Identifiers - are the names for the variables, classes,constants and methods
They can be in any length
Must start with a letter, _ , or a dollar sign
Cannot be reserved words
Variables
hold information like 12, Hello, g, $#$$#&*FGYY
Ex. Radius = 4, where radius is the variable
Declaring variables
When declaring a variable, you must have the data type and the variable
Ex. int age; or double income;, char letter, String name;
Where int, is a whole name like 56
Where double, is a number with decimals like 445.333333
Where char, is a letter like t or U
Therefore a variable can be declared like:
int radius = 1;or int radius;char letter = t;or char letter;
radius = 1; letter = t;
Constant is a variable that is final, which means that the value of the constant cannot be
changed
Ex. final int radius = 4;
www.notesolution.com
Literals is the value that a variable holds.
Example. Int x = 5, the literal value is 5
Evaluating an Expression
When solving a expression, first look for brackets, and solve what is in the brackets
Next, look for multiplication and division signs, from left to right
Next, look for additions and subtraction signs, from left to right
Ex. 3 + 4 * 4 + 5 * (4 + 3) 1= 3 + 4 * 4 + 5 * 7 1= 3 + 16 + 5 * 7 1
= 3 + 16 + 35 1= 19 + 35 -1 = 54 1
= 53
Shortcut Operators
OperatorExampleEquivalent
+= i += 8i = i + 8
-=f -= 8.0f = f - 8.0
*=i *= 8i = i * 8
/=i /= 8i = i / 8
%=i %= 8i = i % 8
www.notesolution.com

Loved by over 2.2 million students

Over 90% improved by at least one letter grade.

Leah — University of Toronto

OneClass has been such a huge help in my studies at UofT especially since I am a transfer student. OneClass is the study buddy I never had before and definitely gives me the extra push to get from a B to an A!

Leah — University of Toronto
Saarim — University of Michigan

Balancing social life With academics can be difficult, that is why I'm so glad that OneClass is out there where I can find the top notes for all of my classes. Now I can be the all-star student I want to be.

Saarim — University of Michigan
Jenna — University of Wisconsin

As a college student living on a college budget, I love how easy it is to earn gift cards just by submitting my notes.

Jenna — University of Wisconsin
Anne — University of California

OneClass has allowed me to catch up with my most difficult course! #lifesaver

Anne — University of California
Description
Chapter 3 Identifiers - are the names for the variables, classes,constants and methods They can be in any length Must start with a letter, _ , or a dollar sign Cannot be reserved words Variables hold information like 12, Hello, g, $#$$#&*FGYY Ex. Radius = 4, where radius is the variable Declaring variables When declaring a variable, you must have the data type and the variable Ex. int age; or double income;, char letter, String name; Where int, is a whole name like 56 Where double, is a number with decimals like 445.333333 Where char, is a letter like t or U Therefore a variable can be declared like: int radius = 1; or int radius; char letter = t; or char letter; radius = 1; letter = t; Constant is a variable that is final, which means that the value of the constant cannot be changed Ex. final int radius = 4; www.notesolution.com
More Less
Unlock Document


Only pages 1-2 are available for preview. Some parts have been intentionally blurred.

Unlock Document
You're Reading a Preview

Unlock to view full version

Unlock Document

Log In


OR

Don't have an account?

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit