- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathString_equal.java
More file actions
Latest commit
28 lines (28 loc) · 812 Bytes
/
Copy pathString_equal.java
File metadata and controls
28 lines (28 loc) · 812 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
importjava.util.Scanner;
publicclassString_equalextendsqwertyuiop
{
publicstaticvoidmain(Stringargs[])
{
try (Scannersc = newScanner(System.in)) {
System.out.println("Enter 10 Strings: ");
Stringa[]=newString[10];
Stringb="";
for(inti=0;i<10;i++)
a[i]=sc.nextLine();
System.out.println("Enter String to be searched: ");
b=sc.nextLine();intc=0;
for(inti=0;i<10;i++)
{
if(b==a[i])
{
c=1;
break;
}
}
if(c==1)
System.out.println("Found");
else
System.out.println("Not found");
}
}
}