-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathp17.java
26 lines (24 loc) · 809 Bytes
/
p17.java
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
/*equals():It avaialbe in String Class. It use to compare two Strings for equality.The equals function return boolean value.
equalsIgnoreCase():It avaialbe in String Class. It use to compare two Strings for equality.This function avoid case sensitivity.This () also returns boolean value.
*/
import java.util.*;
class p17
{
public static void main(String [] args)
{
Scanner sc=new Scanner(System.in);
String name,names;
System.out.print("Enter 1st String:");
name=sc.nextLine();
System.out.print("Enter 2nd String:");
names=sc.nextLine();
if(name.equals(names)==true) //name.equalsIgnoreCase(names);
{
System.out.println("Equal");
}
else
{
System.out.println("Not equal");
}
}
}