This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.task.task38.task3803; | |
/* | |
Runtime исключения (unchecked exception) | |
*/ | |
public class VeryComplexClass | |
{ | |
public void methodThrowsClassCastException() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.task.task38.task3802; | |
/* | |
Проверяемые исключения (checked exception) | |
*/ | |
import java.io.FileReader; | |
public class VeryComplexClass | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.task.task38.task3801; | |
public class NameChecker { | |
private static final int MAX_NUMBER_OF_CHARACTERS = 100500; | |
public static int getNumberOfCharacters(String name) throws Exception { | |
if (name == null) | |
throw new NameIsNullException(); | |
else if (name.isEmpty()) | |
throw new NameIsEmptyException(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.task.task37.task3706; | |
import java.util.Arrays; | |
import java.util.List; | |
/* | |
Давно забытый Array | |
*/ | |
public class Solution { | |
public static void main(String[] args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.task.task37.task3713; | |
import com.javarush.task.task37.task3713.space.crew.AbstractCrewMember; | |
import com.javarush.task.task37.task3713.space.SpaceShip; | |
/* | |
Chain of Responsibility | |
*/ | |
public class Solution { | |
public static void main(String[] args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.task.task37.task3712; | |
public class Basketball extends Game | |
{ | |
public void prepareForTheGame() | |
{ | |
System.out.println ( "Preparing for the Basketball game..." ); | |
} | |
public void playGame() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.task.task37.task3711; | |
public class CPU { | |
void calculate() { | |
System.out.println("Making some CPU calculations..."); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.task.task37.task3710; | |
import com.javarush.task.task37.task3710.decorators.RedShapeDecorator; | |
import com.javarush.task.task37.task3710.shapes.Circle; | |
import com.javarush.task.task37.task3710.shapes.Rectangle; | |
import com.javarush.task.task37.task3710.shapes.Shape; | |
/* | |
Decorator | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.task.task37.task3709; | |
import com.javarush.task.task37.task3709.connectors.Connector; | |
import com.javarush.task.task37.task3709.connectors.SecurityProxyConnector; | |
import com.javarush.task.task37.task3709.connectors.SimpleConnector; | |
/* | |
Security Proxy | |
*/ | |
public class Solution { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.task.task37.task3714; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.LinkedHashMap; | |
import java.util.Map; | |
/* | |
Древний Рим |