Answered step by step
Verified Expert Solution
Link Copied!

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) p.startsWith ("United Kingdom"))
map p.touppercase (*)
sorted ()
. forEach System,out.printin (p);
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 =3. toupperCase ();
if (value, startsWith ("UNITED KINGDOM"))
system. out. printin (s, toUpperCase ());
}
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Building The Data Warehouse

Authors: W. H. Inmon

4th Edition

0764599445, 978-0764599446

More Books

Students also viewed these Databases questions

Question

Describe new developments in the design of pay structures. page 475

Answered: 1 week ago