in JAVA Write a program to accept names from the user, print all the names which have the surname "Patel" in it.
Answers
Answered by
1
Answer:
public class Main
{
public static void main(String[] args) {
String[] arr = {"Sujay patel" , "samarth sharma" , "venka patel"};
for(int i = 0; i < 3; i++){
if(arr[i].endsWith("patel")){
System.out.println(arr[i]);
}
}
System.out.println("Hello World");
}
}
Explanation:
Similar questions
Physics,
8 days ago
English,
8 days ago
English,
8 days ago
CBSE BOARD XII,
16 days ago
Math,
16 days ago
Math,
9 months ago
Computer Science,
9 months ago