Lesson 2
Java Variables Explained
Hi friends today we will explain you about variables in detail. So let's get start it. we discussed in the last lesson that
String myName = "Noman";
This is the text and the text is stored in the String variable. Now if we have to save number or true/false value or some list of data then java language provide us some other data types like for numbers
int numb = 4;
Here int is the data type numb is the variable name that stores the number 4 in it. and = is the assignment operator and 4 is the value that is stored in the numb.
Like the number we can save true/false values and Java provide us the data variable that is
boolean b = true;
These are the basic types that we are going to use in next tutorials so keep it in mind. Now your task is to try these data types in any IDE so that you get idea how they work.
Some data types are user defined that we called objects which can have int, string or boolean or array of any data type.
0 comments:
Post a Comment