Learning about Variables
Using Variables is one of the most basic and important subjects
in programming, so this lesson is very important.
Variables are destined to save data.
You can save in variable Text or number.
For example, you can have one variable that holds the Text "Hello and Goodbye",
and have another variable that holds the number 623882
You can think about variables as a cabinet's drawers.
Every drawer has a sticker on it with its unique name.
You can put in each one of the drawers one number or one text String.
During your program, you can open the drawer with the sticker "TheUserName"
and get the text string that found inside the drawer.
You can also delete the text string that found inside the drawer
and put instead of it other text string.
Right now, we are going learn about 2 variable types.
The first type called Integer.
Integer variable can store an Integer number (round number without any fraction)
between -32,768 to 32,767.
You can store in Integer variable the number 0 or the number 375 or
the number -46, but you can't store the number 4.5 (Because of the .5)
or the number 100,000 (Because It's bigger than 32767) or the
number -50,042 (Because it's smaller than -32,768)
The second type called String.
You can store in String variable any text that you want.
For example "Hello" or "abcDDefGhIjk123456 blah blah %$#@!??? Blah!"
Popular Posts
-
Tutorials Chapter 1 : What is SQL Server? Chapter 2 : Compare SQL Server and MS Access Chapter 3 : What is MSDE ? Chapter 4 : SQL Server Edi...
-
Type Casting Converting an expression of a given type into another type is known as type-casting. We have already seen some ways to type cas...
-
* Install software as described in Software needed for the lab above. * Once you installed J2SE SDK, please check if it is installe...
-
SQL Server (and SQL Server Express) supports two authentication modes: 1. Windows Authentication mode 2. Mixed Mode (Windows Authentication ...
-
JSP scripting elements let you insert Java code into the servlet that will be generated from the current JSP page. There are three forms: ...
-
SQL Server Express is a free, easy to use, redistributable version of SQL Server 2005 designed for building simple data-driven applications....
-
4.2 The Framework Class Library Now that you have a taste of the goals and groundwork laid by the CLR and managed code, let’s taste ...
-
Namespaces Namespaces allow to group entities like classes, objects and functions under a name. This way the global scope can be divided in ...
-
Java Server Pages JavaServer Pages (JSP) technology is the Java platform technology for delivering dynamic content to web clients in a por...
-
Steps to follow: 1. Write Person.java as shown below in Code-11.1.a under personpackage directory. (You are welcome to do this work using ei...
No comments:
Post a Comment