Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assume that a list contains the string values as: United Kingdom, Ireland, United Kingdom, Germany, India, Mumbai, France, Britany, South Korea, Seoul } Consider the
Assume that a list contains the string values as: "United Kingdom, Ireland", "United Kingdom, Germany", "India, Mumbai", "France, Britany", "South Korea, Seoul"
Consider the below codes:
i
System.out.printin Places from United Kingdom:"; myPlaces.strean
filter p pstartsWith United Kingdom"
map ptouppercase
sorted
forEach System,out.printin ;
ii
Collections? sort myPlaces ;
System. out.printin Places from United Kingdom:"
for String : myPlaces
i
if s startswith United Kingdom";
System. out.println s toUpperCase ;
iii.
Collections. sort myplaces ;
System.out.printin Places from United Kingdom:";
for String s: rypiaces
i
String value toupperCase ;
if value startsWith UNITED KINGDOM"
system. out. printin s toUpperCase ;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started