diff --git a/core-java/src/main/java/com/baeldung/scope/BracketScopeExample.java b/core-java/src/main/java/com/baeldung/scope/BracketScopeExample.java deleted file mode 100644 index 37ae211dcb..0000000000 --- a/core-java/src/main/java/com/baeldung/scope/BracketScopeExample.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.baeldung.variable.scope.examples; - -public class BracketScopeExample { - - public void mathOperationExample() { - Integer sum = 0; - { - Integer number = 2; - sum = sum + number; - } - // compiler error, number cannot be solved as a variable - // number++; - } -} \ No newline at end of file diff --git a/core-java/src/main/java/com/baeldung/scope/ClassScopeExample.java b/core-java/src/main/java/com/baeldung/scope/ClassScopeExample.java deleted file mode 100644 index 241c6b466e..0000000000 --- a/core-java/src/main/java/com/baeldung/scope/ClassScopeExample.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.baeldung.variable.scope.examples; - -public class ClassScopeExample { - - Integer amount = 0; - - public void exampleMethod() { - amount++; - } - - public void anotherExampleMethod() { - Integer anotherAmount = amount + 4; - } -} \ No newline at end of file diff --git a/core-java/src/main/java/com/baeldung/scope/LoopScopeExample.java b/core-java/src/main/java/com/baeldung/scope/LoopScopeExample.java deleted file mode 100644 index 7bf92a6d26..0000000000 --- a/core-java/src/main/java/com/baeldung/scope/LoopScopeExample.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.baeldung.variable.scope.examples; - -import java.util.Arrays; -import java.util.List; - -public class LoopScopeExample { - - List listOfNames = Arrays.asList("Joe", "Susan", "Pattrick"); - - public void iterationOfNames() { - String allNames = ""; - for (String name : listOfNames) { - allNames = allNames + " " + name; - } - // compiler error, name cannot be resolved to a variable - // String lastNameUsed = name; - } -} diff --git a/core-java/src/main/java/com/baeldung/scope/MethodScopeExample.java b/core-java/src/main/java/com/baeldung/scope/MethodScopeExample.java deleted file mode 100644 index e62c6a2a1c..0000000000 --- a/core-java/src/main/java/com/baeldung/scope/MethodScopeExample.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.baeldung.variable.scope.examples; - -public class MethodScopeExample { - - public void methodA() { - Integer area = 2; - } - - public void methodB() { - // compiler error, area cannot be resolved to a variable - // area = area + 2; - } -} \ No newline at end of file diff --git a/core-java/src/main/java/com/baeldung/scope/NestedScopesExample.java b/core-java/src/main/java/com/baeldung/scope/NestedScopesExample.java deleted file mode 100644 index fcd23e5ae0..0000000000 --- a/core-java/src/main/java/com/baeldung/scope/NestedScopesExample.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.baeldung.variable.scope.examples; - -public class NestedScopesExample { - - String title = "Baeldung"; - - public void printTitle() { - System.out.println(title); - String title = "John Doe"; - System.out.println(title); - } -} \ No newline at end of file