Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bffcd30

Browse files
committedApr 3, 2024
Content and Code Added
1 parent e03d27f commit bffcd30

File tree

2 files changed

+42
-4
lines changed

2 files changed

+42
-4
lines changed
 

‎Basic.java

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,34 @@
11
class Basic{
22
public static void main(String[] a){
33

4-
// Starting with the Basics of the Program
5-
// Typing the main text content on the screen
4+
// Starting with the Basics of the Programzx
65
System.out.println("Hello World !");
76

7+
// Data Types in JAVA
8+
// 1. Primary Data Types in JAVA
9+
boolean bool1 = true;
10+
System.out.println("A Boolean Value in JAVA is : " + bool1);
11+
12+
byte a1 = 1;
13+
System.out.println("A Byte Variable's Value in JAVA is : " + a1);
14+
15+
short i1 = 12;
16+
System.out.println("A short data type and its value is : " + i1);
17+
18+
int num1 = 234;
19+
System.out.println("A integer data types in JAVA is : " + num1);
20+
21+
long l1 = 234121;
22+
System.out.println("A long data type in JAVA is : " + l1);
23+
24+
float num2 = 34.67f;
25+
System.out.println("A float data type in JAVA is : " + num2);
26+
27+
double num3 = 34.234324;
28+
System.out.println("A Double data type in JAVA is : " + num3);
29+
30+
char c1 = 'a';
31+
System.out.println("A Character data type in JAVA is : " + c1);
32+
833
}
934
}

‎README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ class Class_name{
5454

5555
For running the Code [Window] :
5656

57-
```
57+
```bash
5858
javac file_name.java
5959
java file_name
6060
```
6161

6262
Code Output :
6363

64-
```
64+
```bash
6565
Hello World !
6666
```
6767

@@ -77,6 +77,19 @@ Below we have the explanation regarding the key elements in the above syntax :-
7777
- String[] args : It specific that the user may opt to enter parameters to the JAVA Program. Both forms String[] args or String args[] are acceptable by the compiler.
7878
- System.out.println : This is used to print anything on the console or the output screen.
7979

80+
## Data Types :
81+
82+
- **Boolean** : Used to store the true (1) or false (0).
83+
- **Byte** : This data type is useful in saving the memory space in case for working with large arrays.
84+
- **Short** : This data type comes under the category of integer of 16 bit storage.
85+
- **Int** : This data type is used for storing the numerical values within a particular limit.
86+
- **Long** : This data type is used for storing the unsigned 64-bit numbers at a large storage limit.
87+
- **Float** : This data type is used for storing the 32-bit decimal pointing integers in Source Code.
88+
- **Double** : This data type is used for storing the double precision values in the Source code.
89+
- **Char** : This data type is used for storing the character in any particular variable.
90+
91+
- Note : Code is in the Basic.java file above in the Repo.
92+
8093
### Social Media Links :
8194

8295
- [Instagram Page](https://www.instagram.com/coding.needs/)

0 commit comments

Comments
 (0)
Please sign in to comment.