-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathString_equal.java
More file actions
28 lines (28 loc) · 812 Bytes
/
String_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
import java.util.Scanner;
public class String_equal extends qwertyuiop
{
public static void main(String args[])
{
try (Scanner sc = new Scanner(System.in)) {
System.out.println("Enter 10 Strings: ");
String a[]=new String[10];
String b="";
for(int i=0;i<10;i++)
a[i]=sc.nextLine();
System.out.println("Enter String to be searched: ");
b=sc.nextLine();int c=0;
for(int i=0;i<10;i++)
{
if(b==a[i])
{
c=1;
break;
}
}
if(c==1)
System.out.println("Found");
else
System.out.println("Not found");
}
}
}