0% found this document useful (0 votes)
2 views10 pages

Lecture 3 Java Variables

The document explains the concept of variables in programming, likening them to labeled boxes in a warehouse where data is stored. It emphasizes the importance of case sensitivity in variable names and suggests using camelCase for clarity. Common errors related to variable usage, such as forgotten initialization and vague naming, are also highlighted.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views10 pages

Lecture 3 Java Variables

The document explains the concept of variables in programming, likening them to labeled boxes in a warehouse where data is stored. It emphasizes the importance of case sensitivity in variable names and suggests using camelCase for clarity. Common errors related to variable usage, such as forgotten initialization and vague naming, are also highlighted.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

MD. SALAH UDDIN I Adjunct faculty, EWU


at is a aria e?

.,...,xes

Think of a Labeled Box!

Imagine your computer's memory is a giant warehouse. A Variable is just a box


where you put stuff.

• Label: The variable's name.

S Content: The data (numbers, text).

, Type: What fits in the box (Int, String).



• ensitivit

The ''Identical Twin'' Rule

Java is very picl<y. A tiny change in capitalization creates a


completely different variable.

Are these the same?

myAge � myage

Pro Tip: Always use came/Case (lil<e firstName) for variables!


...,ommon inner it a

Forgotten Initialization

Case Sensitivity Errors

Using Reserved Words 45% Error Rate

Vague Variable Names

You might also like