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
/* | |
ООП - исправь ошибки в наследовании | |
*/ | |
public class Solution { | |
public static interface Alive { | |
Object containsBones(); | |
} |
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
/* | |
Мужчина или женщина? | |
*/ | |
public class Solution { | |
public static void main(String[] args) { | |
Man man = new Man(); | |
Woman woman = new Woman(); | |
printName(man); |
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
/* | |
Статики 2 | |
*/ | |
public class Solution { | |
public static int A; | |
public static int B; | |
static{ | |
BufferedReader reader =new BufferedReader(new InputStreamReader(System.in)); | |
try | |
{ |
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
/* | |
Разные методы для разных типов | |
*/ | |
public class Solution | |
{ | |
public static void main(String[] args) throws IOException | |
{ | |
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); |
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
/* | |
Статики и исключения | |
*/ | |
import java.io.IOException; | |
public class Solution | |
{ | |
public static int A = 0; |
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
public class Earth implements Planet | |
{ | |
private static Earth instance; | |
private Earth() | |
{ | |
} | |
public static Earth getInstance() | |
{ | |
if (instance == null) | |
instance = new Earth(); |
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
/* | |
Порядок загрузки переменных | |
*/ | |
public class Solution | |
{ static | |
{ | |
init(); | |
} | |
static | |
{ |
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
/* | |
Файл в статическом блоке | |
*/ | |
public class Solution | |
{ | |
public static List<String> lines = new ArrayList<String>(); | |
static | |
{ |
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
/* | |
Дебаг, дебаг, и еще раз дебаг | |
*/ | |
public class Solution | |
{ | |
public static void main(String[] args) | |
{ | |
new B(6); |
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
/* | |
ООП - наследование | |
*/ | |
public class Solution | |
{ | |
public static void main(String[] args) | |
{ | |
System.out.println(new Hrivna().getAmount()); |