21
Data and Variables Veri ve Değişkenler •A variable is a named piece of memory that you use to store information in your Java program - a piece of data of some description. •Each named piece of memory that you define in your program is able to store data only of one particular type. •Explicit data values that appear in your program are called literals. •25, for example, is an integer literal of type int.

22
Data and Variables Veri ve Değişkenler •Naming Your Variables •The name that you choose for a variable is called an identifier. •Java is case-sensitive. • You must not include blanks or tabs in the middle of a name, so Betty May  BettyMay Betty_May. •6Pack;you cannot start a name with a numeric •digit. use sixPack as an alternative.

23
Unicode •all Java source code is in Unicode. •original source code that you create may be ASCII, it is converted to Unicode characters internally •your programs can use French, Greek, or Russian variable names

24
Variables and Types Değişkenler ve Tipleri •Variables and Types •each variable that you declare can store values only of a type consistent with the data type of that variable. •You specify the type of a particular variable by using a type name in the variable declaration.

25
Integer Literals •Any integer literal that you specify as a sequence of decimal digits is of type int by default. Thus 1, -9999, and 123456789 are all literals of type int. •If you want to define an integer literal of type long, you need to append an L to the value. The values 1L, -9999L, and 123456789L are all of type long.

26
Declaring Integer Variables Integer Değişkeni Tanımlamak There are four types of variables that you can use to store integer data. •All of these are signed; that is, they can store both negative and positive values. •The four integer types differ in the range of values they can store, so the choice of type for a variable depends on the range of data values you are likely to need.

28
Floating Point Data Types Kayan Nokta Veri Tipleri •float from -3.4E38 to +3.4E38 •doublefrom -1.7E308 to +1.7E308 • Floating Point Literals •the distance from the Earth to the Sun is approximately 149,600,000 kilometers, •more conveniently written as 1.496E8