You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+63Lines changed: 63 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -79,6 +79,8 @@ Below we have the explanation regarding the key elements in the above syntax :-
79
79
80
80
## Data Types :
81
81
82
+
### Primitive
83
+
82
84
-**Boolean** : Used to store the true (1) or false (0).
83
85
-**Byte** : This data type is useful in saving the memory space in case for working with large arrays.
84
86
-**Short** : This data type comes under the category of integer of 16 bit storage.
@@ -90,6 +92,67 @@ Below we have the explanation regarding the key elements in the above syntax :-
90
92
91
93
Note : Code is in the Basic.java file above in the Repo.
92
94
95
+
### Non-Primitive
96
+
97
+
-**String** : It is a kind of data type which is known from its other standard line, sequence of characters
98
+
99
+
Syntax Code :
100
+
101
+
```
102
+
String str1 = "This is a simple string in JAVA";
103
+
```
104
+
105
+
-**Class** : It is a kind of user-defined data type in JAVA also in different programming languages which is created in order to create an entity or object in the main class [Source Code]
106
+
107
+
Syntax Code :
108
+
109
+
```
110
+
class Class_name{
111
+
// class members
112
+
public int number = 12;
113
+
114
+
// class methods
115
+
public void display(){
116
+
System.out.println("Display Function here !");
117
+
}
118
+
}
119
+
```
120
+
121
+
-**Object** : It is a kind of entity created in order to use the class here !
122
+
123
+
Syntax Code :
124
+
125
+
```
126
+
class First{
127
+
128
+
}
129
+
130
+
class Class_main{
131
+
public static void main(String[] a){
132
+
First obj1 = new First();
133
+
}
134
+
}
135
+
```
136
+
137
+
-**Interface** : Interfaces specify what a class must do and not how. It is the blueprint of the class.
138
+
139
+
Syntax Code :
140
+
141
+
```
142
+
interface interface_name{
143
+
// inteface members
144
+
// inteface methods but not defined
145
+
}
146
+
```
147
+
148
+
-**Arrays** : An Array is a group of like-typed variables that are referred to by a common name.
0 commit comments