Joomla Vorlagen by Website Hosting

PL1 - 10th laboratory (Strings)

Work with text in the class „Book“ - it same as in a laboratory 8th.

Work with the project pl1-lab10.zip.

1. A implementation StringLengthComparator replace with:

  • a "nested" class;
  • a local class;
  • an "anonymous" class;
  • alambda expression;
  • a reference method.

Explain why is no suitable an implementation by "inner class".

Following tasks implement using streams  (API in java.util.stream)

2. Print words longer then 2.

3. Print words converted to "lower-case" without duplicates (use a method distinct)

4. Count an average length of words (converted to "lower-case" without duplicates).

5. Overview an implementation provided by a tutor that counts frequencies of words.

6. Print words ordered according their frequencies.

7. Modify previous printing tasks that they return List instead of printing.

Homework

Count average length of words that contains a letter "a".