We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 514a23a commit 4a5ebf8Copy full SHA for 4a5ebf8
equals method
@@ -0,0 +1,33 @@
1
+
2
3
+//remember in this programe i not used funcation for the equal
4
+class hardik
5
+{
6
+ String car;
7
+ int speed;
8
9
+ hardik(String a,int b)
10
+ {
11
+ this.car=a;
12
+ this.speed=b;
13
+ }
14
15
+}
16
+public class equals {
17
18
+ public static void main(String[] args)
19
20
+ //this statement give the default false value because we are take object within the same class
21
22
+ //all the value are the same
23
+// hardik obj1= new hardik("charger",230);
24
+// hardik obj2= new hardik("charger",230);
25
26
+ //value is different
27
28
+ hardik obj1= new hardik("mustang",230);
29
+ hardik obj2= new hardik("charger",230);
30
31
+ System.out.println(obj1.equals(obj2));
32
33
0 commit comments