java variables | variables in java | what is java | how to use variable in java |
Variables in java
variables type in java :
- Integer - Integer it is a only to access a as numbers only absolute numbers only "int " is keyword of the integer variables
- Float - Float is a like a non absolute variables like 3.8 (or) 7.9 " float " is a keyword of the float
- String - String datatype is a using some words (or) sentence also used
- character - character is like a one letter used here that letter not only define as a Captial letter (or) small letter it should have both is assesible but it have only one letter using at the time and the keyword of the character is " char "
- Double - it is also like a float but it should have restricted to put the values in after the dot
Integer datatype :
-------------------------------------------
| int number = 15; |
| System.out.println(number); |
-------------------------------------------
Float Datatype:
-------------------------------------------
| float number = 1.5; |
| System.out.println(number); |
-------------------------------------------
Charcter Datatype:
-------------------------------------------
| char number = 'A'; |
| System.out.println(number); |
-------------------------------------------
string Datatype:
-------------------------------------------
| String number = "apple"; |
| System.out.println(number); |
-------------------------------------------
Double Datatype :
-------------------------------------------------------------------------
| double number = 4.94065645841246544e-324d; |
| System.out.println(number); |
--------------------------------------------------------------------------
Comments
Post a Comment