CodeGym/Java Course/рдореЙрдбреНрдпреВрд▓ 2: рдЬрд╛рд╡рд╛ рдХреЛрд░/рд╕реНрддрд░ рдХреЗ рд▓рд┐рдП рдЕрддрд┐рд░рд┐рдХреНрдд рдкрд╛рда

рд╕реНрддрд░ рдХреЗ рд▓рд┐рдП рдЕрддрд┐рд░рд┐рдХреНрдд рдкрд╛рда

рдЙрдкрд▓рдмреНрдз

рдЬрд╛рд╡рд╛ рдореЗрдВ рд╡рдВрд╢рд╛рдиреБрдХреНрд░рдо рдмрдирд╛рдо рд░рдЪрдирд╛

рдпрд╣ рд▓реЗрдЦ рдЬрд╛рд╡рд╛ рдореЗрдВ рд╡рдВрд╢рд╛рдиреБрдХреНрд░рдо рдФрд░ рд░рдЪрдирд╛ рдХреА рдЕрд╡рдзрд╛рд░рдгрд╛рдУрдВ рдХреЛ рджрд┐рдЦрд╛рддрд╛ рд╣реИред рдкрд╣рд▓рд╛ рдЙрджрд╛рд╣рд░рдг рдЖрдкрдХреЛ рд╡рдВрд╢рд╛рдиреБрдХреНрд░рдо рдХреЛ рд╕рдордЭрдиреЗ рдореЗрдВ рдорджрдж рдХрд░реЗрдЧрд╛ред рдмрд╛рдж рдХреЗ рдЙрджрд╛рд╣рд░рдг рдЖрдкрдХреЛ рдпрд╣ рд╕рдордЭрдиреЗ рдореЗрдВ рдорджрдж рдХрд░реЗрдВрдЧреЗ рдХрд┐ рд╡рдВрд╢рд╛рдиреБрдХреНрд░рдо рдХреЗ рдЕрдкрдиреЗ рдЙрдкрдпреЛрдЧ рдХреЛ рдмреЗрд╣рддрд░ рдмрдирд╛рдиреЗ рдХреЗ рд▓рд┐рдП рд░рдЪрдирд╛ рдХрд╛ рдЙрдкрдпреЛрдЧ рдХреИрд╕реЗ рдХрд░реЗрдВред

рдЬрд╛рд╡рд╛ рдореЗрдВ рдПрдХрд╛рдзрд┐рдХ рд╡рдВрд╢рд╛рдиреБрдХреНрд░рдоред рд░рдЪрдирд╛ рдФрд░ рд╡рдВрд╢рд╛рдиреБрдХреНрд░рдо рдХреА рддреБрд▓рдирд╛

рдпрд╣ рд▓реЗрдЦ рдПрдХрд╛рдзрд┐рдХ рд╡рдВрд╢рд╛рдиреБрдХреНрд░рдо рдХреА рдЬрд╛рдБрдЪ рдХрд░рддрд╛ рд╣реИ рдФрд░ рдлрд┐рд░ рд╡рдВрд╢рд╛рдиреБрдХреНрд░рдо рдкрд░ рд░рдЪрдирд╛ рдХреЗ рд▓рд╛рднреЛрдВ рдХреА рдкрдбрд╝рддрд╛рд▓ рдХрд░рддрд╛ рд╣реИред

3
рдЯрд╛рд╕реНрдХ
Java Core,  рд╕реНрддрд░ 3рд╕рдмрдХ 2
рд▓реЙрдХ
Beer
There's no such thing as too much programming... But "too much beer" can result in "it's time to go home" or "sleep on the floor". In this task, you will get two interfaces. The BeerLover class needs to implement one of them. At the same time, you need to understand the relationship between the READY_TO_GO_HOME variable and the isReadyToGoHome method.
3
рдЯрд╛рд╕реНрдХ
Java Core,  рд╕реНрддрд░ 3рд╕рдмрдХ 2
рд▓реЙрдХ
Beer. Part 2. The recovery.
Beer can be both alcoholic and nonalcoholic. The difference is huge. But no matter what type of beer you have, it is the process of drinking that unites man with beer. In this task, we will only drink alcoholic beer. Enable the Drink interface in the AlcoholicBeer class and implement all of its methods.
3
рдЯрд╛рд╕реНрдХ
Java Core,  рд╕реНрддрд░ 3рд╕рдмрдХ 2
рд▓реЙрдХ
Don't mix beer with cola
Do you prefer beer or cola? Perhaps it depends on your mood? Either way, the most logical interface between humans and beer or between humans and cola can be expressed in a single word: "drink". Implement the Drink interface in the Beer and Cola classes.
3
рдЯрд╛рд╕реНрдХ
Java Core,  рд╕реНрддрд░ 3рд╕рдмрдХ 2
рд▓реЙрдХ
Selectable and Updatable
Galaxy Rush's engineering department decided to set up a surveillance system for Planet Wild Robots. Your task is simple: make a Screen class that implements the Selectable and Updatable interfaces.
8
рдЯрд╛рд╕реНрдХ
Java Core,  рд╕реНрддрд░ 3рд╕рдмрдХ 2
рд▓реЙрдХ
Four mistakes
Once again you're working on someone else's code, and once again you have to fix their mistakes. You'll need to gradually get used to this process. Luckily, this time, it's a very simple task about interfaces, with only 33 lines of code. So, no whining, just get going and fix the bugs. Hint: There are only four bugs.
8
рдЯрд╛рд╕реНрдХ
Java Core,  рд╕реНрддрд░ 3рд╕рдмрдХ 2
рд▓реЙрдХ
Buggy initializeIdAndName
Something's wrong with this code! Your task is to fix the program so that it compiles and runs. First, figure out why it isn't working and then implement the initializeIdAndName method in the User class. In this case, the User class's initializeIdAndName method must return a User.
3
рдЯрд╛рд╕реНрдХ
Java Core,  рд╕реНрддрд░ 3рд╕рдмрдХ 2
рд▓реЙрдХ
Parameterized interface
Remember generics? They are generalizations - parametrized types, right? If not, rack your brain, then search through the lessons, and then search Google. Or use a different order if you'd like. Then, look at this task's code and make the StringObject class implement the SimpleObject interface using a String parameter.
3
рдЯрд╛рд╕реНрдХ
Java Core,  рд╕реНрддрд░ 3рд╕рдмрдХ 2
рд▓реЙрдХ
Hey, are you alive?
The program you are going to write should answer this question. To accomplish this, create a Person interface and add an isAlive() method, which will return whether the Person object is alive. Can you guess which type this method should return?
3
рдЯрд╛рд╕реНрдХ
Java Core,  рд╕реНрддрд░ 3рд╕рдмрдХ 2
рд▓реЙрдХ
All that moves
We are going to create an interface for anything that can move. We'll call it CanMove and give it a speed method. And CanMove will be inherited by all things that moveth upon the ground, and that which moveth through the air. And each shall have its own speed method. And then thou shalt behold it and see a job well done!
3
рдЯрд╛рд╕реНрдХ
Java Core,  рд╕реНрддрд░ 3рд╕рдмрдХ 2
рд▓реЙрдХ
Who's that smarty?
Do you know the difference between Smart and Clever? We do too, but that's a topic for another day. Today we're talking about adding the Secretary and Boss interfaces to the Manager and Subordinate classes. Try to figure out for yourself which interface is best for each class. Good luck!
рдЯрд┐рдкреНрдкрдгрд┐рдпрд╛рдВ
  • рд▓реЛрдХрдкреНрд░рд┐рдп
  • рдирдпрд╛
  • рдкреБрд░рд╛рдирд╛
рдЯрд┐рдкреНрдкрдгреА рд▓рд┐рдЦрдиреЗ рдХреЗ рд▓рд┐рдП рдЖрдкрдХреЛ рд╕рд╛рдЗрди рдЗрди рдХрд░рдирд╛ рд╣реЛрдЧрд╛
рдЗрд╕ рдкреЗрдЬ рдкрд░ рдЕрднреА рддрдХ рдХреЛрдИ рдЯрд┐рдкреНрдкрдгрд┐рдпрд╛рдВ рдирд╣реАрдВ рд╣реИрдВ