forked from Annex5061/java-algorithms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathequals method
More file actions
33 lines (24 loc) · 692 Bytes
/
equals method
File metadata and controls
33 lines (24 loc) · 692 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//remember in this programe i not used funcation for the equal
class hardik
{
String car;
int speed;
hardik(String a,int b)
{
this.car=a;
this.speed=b;
}
}
public class equals {
public static void main(String[] args)
{
//this statement give the default false value because we are take object within the same class
//all the value are the same
// hardik obj1= new hardik("charger",230);
// hardik obj2= new hardik("charger",230);
//value is different
hardik obj1= new hardik("mustang",230);
hardik obj2= new hardik("charger",230);
System.out.println(obj1.equals(obj2));
}
}