-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c7dc10b
commit 0efbaa9
Showing
69 changed files
with
630 additions
and
78 deletions.
There are no files selected for viewing
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
File renamed without changes.
16 changes: 16 additions & 0 deletions
16
...patterns/sec_14_11_the_switch_statement/sec_14_11_1_switch_blocks/MultipleVarsSwitch.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
public class MultipleVarsSwitch { | ||
public static void main(String[] args) { | ||
int a = 5; | ||
switch (a) { | ||
case 0: | ||
case 1: | ||
case 2: | ||
case 3: | ||
System.out.println("not passed"); | ||
break; | ||
default: | ||
System.out.println("passed"); | ||
break; | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...nts_and_patterns/sec_14_9_the_if_statement/sec_14_9_1_the_if_then_statement/NestedIf.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
public class NestedIf { | ||
public static void main(String[] args) { | ||
boolean truth = true; | ||
if (truth) { | ||
if (truth) { | ||
System.out.println("passed"); | ||
} | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...atterns/sec_14_9_the_if_statement/sec_14_9_2_the_if_then_else_statement/IfElseIfElse.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
public class IfElseIfElse { | ||
public static void main(String[] args) { | ||
boolean lie = false; | ||
if (lie) { | ||
System.out.println("not passed"); | ||
} else if (lie && false) { | ||
System.out.println("not passed"); | ||
} else { | ||
System.out.println("passed"); | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...atterns/sec_14_9_the_if_statement/sec_14_9_2_the_if_then_else_statement/NestedIfElse.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
public class SimpleIfElse { | ||
public static void main(String[] args) { | ||
boolean lie = false; | ||
if (lie) { | ||
System.out.println("not passed"); | ||
} else { | ||
if (lie) { | ||
System.out.println("not passed"); | ||
} else { | ||
System.out.println("passed"); | ||
} | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
..._14_postfix_expressions/sec_15_14_2_postfix_increment_operator/ArrayPostfixIncrement.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
public class ArrayPostfixIncrement { | ||
|
||
public static void main(String[] args) { | ||
int[] a = new int[] { 5 }; | ||
int b = a[0]++; | ||
System.out.println(b); | ||
System.out.println("passed"); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
..._14_postfix_expressions/sec_15_14_3_postfix_decrement_operator/ArrayPostfixDecrement.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
public class ArrayPostfixDecrement { | ||
|
||
public static void main(String[] args) { | ||
int[] a = new int[] { 5 }; | ||
int b = a[0]--; | ||
System.out.println(b); | ||
System.out.println("passed"); | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
...prefix_increment_operator/SampleTest.java → ...crement_operator/ArrayElementPrefInc.java
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
6 changes: 3 additions & 3 deletions
6
...prefix_decrement_operator/SampleTest.java → ...crement_operator/ArrayElementPrefDec.java
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
6 changes: 3 additions & 3 deletions
6
...ostfix_increment_operator/SampleTest.java → ...3_unary_plus_operator/ArrayUnaryPlus.java
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
6 changes: 3 additions & 3 deletions
6
...ostfix_decrement_operator/SampleTest.java → ...unary_minus_operator/ArrayUnaryMinus.java
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
10 changes: 10 additions & 0 deletions
10
...15_15_unary_operators/sec_15_15_5_bitwise_complement_operator/ArrayBitwiseComplement.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
public class ArrayBitwiseComplement { | ||
|
||
public static void main(String[] args) { | ||
int[] a = new int[] { 115 }; | ||
int b = ~a[0]; | ||
int c = (-a[0]) - 1; | ||
System.out.println(b == c); | ||
System.out.println("passed"); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...st/resources/test_candidates/ch_8_classes/sec_8_10_record_classes/PrivateRecordClass.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
public class PrivateRecordClass { | ||
public static void main(String[] args) { | ||
Person p = new Person("Mike", "Innopolis"); | ||
System.out.println(p.name()); | ||
System.out.println(p.address()); | ||
System.out.println("passed"); | ||
} | ||
} | ||
private record Person (String name, String address) {} |
9 changes: 9 additions & 0 deletions
9
.../resources/test_candidates/ch_8_classes/sec_8_10_record_classes/ProtectedRecordClass.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
public class ProtectedRecordClass { | ||
public static void main(String[] args) { | ||
Person p = new Person("Mike", "Innopolis"); | ||
System.out.println(p.name()); | ||
System.out.println(p.address()); | ||
System.out.println("passed"); | ||
} | ||
} | ||
protected record Person (String name, String address) {} |
9 changes: 9 additions & 0 deletions
9
...est/resources/test_candidates/ch_8_classes/sec_8_10_record_classes/PublicRecordClass.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
public class ProtectedRecordClass { | ||
public static void main(String[] args) { | ||
Person p = new Person("Mike", "Innopolis"); | ||
System.out.println(p.name()); | ||
System.out.println(p.address()); | ||
System.out.println("passed"); | ||
} | ||
} | ||
public record Person (String name, String address) {} |
9 changes: 9 additions & 0 deletions
9
...est/resources/test_candidates/ch_8_classes/sec_8_10_record_classes/SimpleRecordClass.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
public class SimpleRecordClass { | ||
public static void main(String[] args) { | ||
Person p = new Person("Mike", "Innopolis"); | ||
System.out.println(p.name()); | ||
System.out.println(p.address()); | ||
System.out.println("passed"); | ||
} | ||
} | ||
record Person (String name, String address) {} |
15 changes: 15 additions & 0 deletions
15
..._8_1_class_declarations/sec_8_1_2_generic_classes_and_type_params/DoubleGenericClass.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
public class DoubleGenericClass { | ||
|
||
public static void main(String[] args) { | ||
Generic<String, Integer> g = new Generic<String, Integer>(); | ||
g.method("passed", 123); | ||
} | ||
} | ||
|
||
class Generic<T, K> { | ||
void method(T arg1, K arg2) { | ||
System.out.println((Integer)arg2); | ||
System.out.println((String)arg1); | ||
|
||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
..._declarations/sec_8_3_1_field_modifiers/sec_8_3_1_1_static_fields/PrivateStaticField.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
public class PrivateStaticField { | ||
|
||
private static int var = 2; | ||
|
||
public static void main(String[] args) { | ||
int a = var + 1; | ||
System.out.println("passed"); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...eclarations/sec_8_3_1_field_modifiers/sec_8_3_1_1_static_fields/ProtectedStaticField.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
public class ProtectedStaticField { | ||
|
||
protected static int var = 2; | ||
|
||
public static void main(String[] args) { | ||
int a = var + 1; | ||
System.out.println("passed"); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...d_declarations/sec_8_3_1_field_modifiers/sec_8_3_1_1_static_fields/PublicStaticField.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
public class PublicStaticField { | ||
|
||
public static int var = 2; | ||
|
||
public static void main(String[] args) { | ||
int a = var + 1; | ||
System.out.println("passed"); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...ld_declarations/sec_8_3_1_field_modifiers/sec_8_3_1_2_final_fields/PrivateFinalField.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
public class PrivateFinalField { | ||
|
||
private static final int var = 2; | ||
|
||
public static void main(String[] args) { | ||
int a = var + 1; | ||
System.out.println("passed"); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
..._declarations/sec_8_3_1_field_modifiers/sec_8_3_1_2_final_fields/ProtectedFinalField.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
public class ProtectedFinalField { | ||
|
||
protected static final int var = 2; | ||
|
||
public static void main(String[] args) { | ||
int a = var + 1; | ||
System.out.println("passed"); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...eld_declarations/sec_8_3_1_field_modifiers/sec_8_3_1_2_final_fields/PublicFinalField.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
public class PublicFinalField { | ||
|
||
public static final int var = 2; | ||
|
||
public static void main(String[] args) { | ||
int a = var + 1; | ||
System.out.println("passed"); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...clarations/sec_8_4_3_method_modifiers/sec_8_4_3_2_static_methods/PrivateStaticMethod.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
public class PrivateStaticMethod { | ||
|
||
private static void method () {} | ||
|
||
public static void main(String[] args) { | ||
method(); | ||
System.out.println("passed"); | ||
} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
...arations/sec_8_4_3_method_modifiers/sec_8_4_3_2_static_methods/ProtectedStaticMethod.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
public class ProtectedStaticMethod { | ||
|
||
protected static void method () {} | ||
|
||
public static void main(String[] args) { | ||
method(); | ||
System.out.println("passed"); | ||
} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
...eclarations/sec_8_4_3_method_modifiers/sec_8_4_3_2_static_methods/PublicStaticMethod.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
public class PublicStaticMethod { | ||
|
||
public static void method () {} | ||
|
||
public static void main(String[] args) { | ||
method(); | ||
System.out.println("passed"); | ||
} | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
...8_classes/sec_8_4_method_declarations/sec_8_4_4_generic_methods/PrivateGenericMethod.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
public class PrivateGenericMethod { | ||
|
||
private static <T> void method(T param) {} | ||
|
||
public static void main(String[] args) { | ||
method("param"); | ||
System.out.println("passed"); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...classes/sec_8_4_method_declarations/sec_8_4_4_generic_methods/ProtectedGenericMethod.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
public class ProtectedGenericMethod { | ||
|
||
protected static <T> void method(T param) {} | ||
|
||
public static void main(String[] args) { | ||
method("param"); | ||
System.out.println("passed"); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
..._8_classes/sec_8_4_method_declarations/sec_8_4_4_generic_methods/PublicGenericMethod.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
public class PublicGenericMethod { | ||
|
||
public static <T> void method(T param) {} | ||
|
||
public static void main(String[] args) { | ||
method("param"); | ||
System.out.println("passed"); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...c_8_8_constructor_declarations/sec_8_8_1_formal_parameters/MultipleConstructorParams.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
public class MultipleConstructorParams { | ||
|
||
public static void main(String[] args) { | ||
new Some(1, "some", new float[] { 1f }); | ||
System.out.println("passed"); | ||
} | ||
|
||
|
||
} | ||
|
||
class Some { | ||
public Some(int a, String s, float[] f) {} | ||
} |
9 changes: 0 additions & 9 deletions
9
...ch_8_classes/sec_8_8_constructor_declarations/sec_8_8_1_formal_parameters/SampleTest.java
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
...sec_8_8_constructor_declarations/sec_8_8_1_formal_parameters/SimpleConstructorParams.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
public class SimpleConstructorParams { | ||
|
||
public static void main(String[] args) { | ||
new Some(1); | ||
System.out.println("passed"); | ||
} | ||
|
||
|
||
} | ||
|
||
class Some { | ||
public Some(int a) {} | ||
} |
13 changes: 13 additions & 0 deletions
13
.../sec_8_8_constructor_declarations/sec_8_8_3_constructor_modifiers/PrivateConstructor.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
public class PrivateConstructor { | ||
|
||
public static void main(String[] args) { | ||
new Some(); | ||
System.out.println("passed"); | ||
} | ||
|
||
|
||
} | ||
|
||
class Some { | ||
private Some(int a) {} | ||
} |
13 changes: 13 additions & 0 deletions
13
...ec_8_8_constructor_declarations/sec_8_8_3_constructor_modifiers/ProtectedConstructor.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
public class ProtectedConstructor { | ||
|
||
public static void main(String[] args) { | ||
new Some(); | ||
System.out.println("passed"); | ||
} | ||
|
||
|
||
} | ||
|
||
class Some { | ||
protected Some(int a) {} | ||
} |
Oops, something went wrong.