What is data type ? What are variables ?
while programming in java or in any other language we need to handle a vast variety of data in our program like integer values, floating values, long, double values, character values, etc.
Here, java provides the facility to store or handle multiple data like integer value, character value, decimal value, boolean values, etc. these are called as data types.
Now we will see the various further subgroups of these data types
Integer :- it stores integer values to the computer it’s sub-groups are as follows
byte(10), short(20823), int(9812324), long(2012329874).
Decimal :- it stores decimal values used in a program.
float(14.445), double(8.87123).
Character :- it stores character values to the program.
char(A).
Boolean :- it stores a boolean value to the program which is either true or false.
boolean(True,False).
The data stored in the memory is in the form of binary numbers which is in the form of 011010.
While programming in any language whether it is java or it may be any other language we always need to follow a proper syntax of that language
Also while programming in java we need to take care of the case of the alphabets also because java is a case sensitive language.
In java semicolons (;) are used to end the line
While using braces like { }, ( ), < >, etc we need to check that all the braces used in the programme should be present in the pair always means if there is a open braces used in the programm and it should always have a closing braces also otherwise it will give some error
Variables :-
Variables are used in the programming language for providing the locations of the values which we are providing in the program.
Variables used in the program begins with the small letter and follows the camel case letters
While handling any character values in the program we need put that characters in the single quotes ( ‘a’ ), and to store string we need to use double quotes ( “string” )
Also while storing a float value to the program we need to write f at the end of the numer.
I hope you’ll get some useful knowledge about programming and it’ll help you to learn the about the programming from the beginning level
Thankyou
BY :- ADARSH GUPTA
No comments:
Post a Comment