undefined

Practice with streams | Level 8

Java Core
Level 8 , Lesson 8
Available

"Hello, Amigo!"

undefined
10
Task
Java Core, level 8, lesson 8
Locked
Wrapper (Decorator)
Figure out what the program does. By analogy with the DecoratorRunnableImpl class, create a DecoratorMyRunnableImpl class.
undefined
10
Task
Java Core, level 8, lesson 8
Locked
Extending AmigoOutputStream
Using the wrapper (decorator) design pattern, extend the functionality of AmigoOutputStream. In the QuestionFileOutputStream class, the following functionality should be implemented for the close() method: 1. Display "Do you really want to close the stream? Y/N". 2. Read a line. 3. If the read line
undefined
10
Task
Java Core, level 8, lesson 8
Locked
AmigoOutputStream
1 Change the AmigoOutputStream class so that it wraps the FileOutputStream class. Use inheritance. 2 When the close() method is called, perform the following sequence of actions: 2.1 Call the flush() method. 2.2 Append the following text "CodeGym © All rights reserved." Use the getBytes() method. 2.
undefined
10
Task
Java Core, level 8, lesson 8
Locked
UnsupportedFileName
Change the TxtInputStream class so that it only works with txt files (* .txt). For example, first.txt or name.1.part3.txt. If a non-txt file is passed (e.g. file.txt.exe), then the constructor should throw an UnsupportedFileNameException. Think about what else you need to do if an exception is throw
undefined
10
Task
Java Core, level 8, lesson 8
Locked
Table
Change the TableInterfaceWrapper class so that it wraps TableInterface. The setModel method should display the number of elements in the new list before updating the model. The getHeaderText method should return the text in upper case. Use the toUpperCase() method.
Comments (20)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
Jurij Thmsn Level 24, Flensburg, Germany
9 April 2021
check out these links for further information about decorator patterns: general: https://refactoring.guru/design-patterns/decorator java: https://refactoring.guru/design-patterns/decorator/java/example
Nyerges Ferenc Level 23, Bükkábrány, Hungary
11 June 2020
Small note - in the strings, after "body" it worth adding a space too... was hard to figure out, maybe helps to someone.
Manish Sinha Level 26, london, United Kingdom
28 April 2020
these tasks really helps to understand the topic in better and practical way.
Attila Level 25
20 April 2020
If you struggle understanding this subject, here is a great example with explanation: https://www.geeksforgeeks.org/decorator-pattern/ https://www.geeksforgeeks.org/the-decorator-pattern-set-2-introduction-and-design/?ref=rp https://www.geeksforgeeks.org/decorator-pattern-set-3-coding-the-design/?ref=rp Hints: #3 super (fileName); #4 Java String endsWith() method #5 tableInterface.setModel(rows);
MaGaby2280 Level 39, Guatemala City, Guatemala
20 February 2020
Hard tasks... and sometimes it all comes down to a point or a space ;o) Hard earned dark matters... 1020
- FniJnn - Level 33, Paris, France
1 December 2019
That's toughhhh
Robert Constantinescu Level 25, Bucharest, Romania
1 December 2019
I believe these tasks really need a review for the conditions unless the conditions are intended to have mistakes.
Piotr Wikarski Level 19, Birmingham, United Kingdom
2 November 2019
Another great tasks for my java muscles in my brain ! 💪💪💪
3 September 2019
I find the requirements of the tasks to be harder to interpret than understanding all this wrappers information. I guess is wouldn't hurt the instructions to be a little more comprehensible.
Hossein Shams Level 26, Atlanta, United States
27 August 2019
Your solution to the task was better than 57% other students. You solved it in 2214500 attempts. The average number of attempts for this task is 2214501.