diff --git a/checkstyle.xml b/checkstyle.xml
index 5bbc5d72229a..912a6b2488e0 100644
--- a/checkstyle.xml
+++ b/checkstyle.xml
@@ -174,7 +174,7 @@
-
+
diff --git a/src/main/java/com/thealgorithms/datastructures/bags/Bag.java b/src/main/java/com/thealgorithms/datastructures/bags/Bag.java
index 66da3d34fcbf..ff5c832baeaf 100644
--- a/src/main/java/com/thealgorithms/datastructures/bags/Bag.java
+++ b/src/main/java/com/thealgorithms/datastructures/bags/Bag.java
@@ -13,7 +13,7 @@ public class Bag implements Iterable {
private Node firstElement; // first element of the bag
private int size; // size of bag
- private static class Node {
+ private static final class Node {
private Element content;
private Node nextElement;
diff --git a/src/main/java/com/thealgorithms/datastructures/dynamicarray/DynamicArray.java b/src/main/java/com/thealgorithms/datastructures/dynamicarray/DynamicArray.java
index e1697f44cacb..186f301f622d 100644
--- a/src/main/java/com/thealgorithms/datastructures/dynamicarray/DynamicArray.java
+++ b/src/main/java/com/thealgorithms/datastructures/dynamicarray/DynamicArray.java
@@ -153,7 +153,7 @@ public Iterator iterator() {
return new DynamicArrayIterator();
}
- private class DynamicArrayIterator implements Iterator {
+ private final class DynamicArrayIterator implements Iterator {
private int cursor;
diff --git a/src/main/java/com/thealgorithms/datastructures/graphs/WelshPowell.java b/src/main/java/com/thealgorithms/datastructures/graphs/WelshPowell.java
index 3b823f02388d..0981638d4903 100644
--- a/src/main/java/com/thealgorithms/datastructures/graphs/WelshPowell.java
+++ b/src/main/java/com/thealgorithms/datastructures/graphs/WelshPowell.java
@@ -17,7 +17,7 @@ public final class WelshPowell {
private WelshPowell() {
}
- static class Graph {
+ static final class Graph {
private HashSet[] adjacencyLists;
private Graph(int vertices) {
diff --git a/src/main/java/com/thealgorithms/datastructures/hashmap/hashing/Intersection.java b/src/main/java/com/thealgorithms/datastructures/hashmap/hashing/Intersection.java
index ad3f617cef5a..54bd10de50fa 100644
--- a/src/main/java/com/thealgorithms/datastructures/hashmap/hashing/Intersection.java
+++ b/src/main/java/com/thealgorithms/datastructures/hashmap/hashing/Intersection.java
@@ -12,7 +12,7 @@
import java.util.List;
import java.util.Map;
-public class Intersection {
+public final class Intersection {
public static List intersection(int[] arr1, int[] arr2) {
if (arr1 == null || arr2 == null || arr1.length == 0 || arr2.length == 0) {
diff --git a/src/main/java/com/thealgorithms/datastructures/heaps/LeftistHeap.java b/src/main/java/com/thealgorithms/datastructures/heaps/LeftistHeap.java
index cfec2b3c54bd..0e4bcc2c8b80 100644
--- a/src/main/java/com/thealgorithms/datastructures/heaps/LeftistHeap.java
+++ b/src/main/java/com/thealgorithms/datastructures/heaps/LeftistHeap.java
@@ -13,7 +13,7 @@
*/
public class LeftistHeap {
- private class Node {
+ private final class Node {
private int element, npl;
private Node left, right;
diff --git a/src/main/java/com/thealgorithms/datastructures/lists/CircleLinkedList.java b/src/main/java/com/thealgorithms/datastructures/lists/CircleLinkedList.java
index c42b10455d14..6eb9d75fe58f 100644
--- a/src/main/java/com/thealgorithms/datastructures/lists/CircleLinkedList.java
+++ b/src/main/java/com/thealgorithms/datastructures/lists/CircleLinkedList.java
@@ -2,7 +2,7 @@
public class CircleLinkedList {
- private static class Node {
+ private static final class Node {
Node next;
E value;
diff --git a/src/main/java/com/thealgorithms/datastructures/lists/Merge_K_SortedLinkedlist.java b/src/main/java/com/thealgorithms/datastructures/lists/Merge_K_SortedLinkedlist.java
index 7206ccecf25e..d98335b1e5b9 100644
--- a/src/main/java/com/thealgorithms/datastructures/lists/Merge_K_SortedLinkedlist.java
+++ b/src/main/java/com/thealgorithms/datastructures/lists/Merge_K_SortedLinkedlist.java
@@ -43,7 +43,7 @@ Node mergeKList(Node[] a, int N) {
return head;
}
- private class Node {
+ private final class Node {
private int data;
private Node next;
diff --git a/src/main/java/com/thealgorithms/datastructures/trees/GenericTree.java b/src/main/java/com/thealgorithms/datastructures/trees/GenericTree.java
index d348467815c7..39af10bac813 100644
--- a/src/main/java/com/thealgorithms/datastructures/trees/GenericTree.java
+++ b/src/main/java/com/thealgorithms/datastructures/trees/GenericTree.java
@@ -16,7 +16,7 @@
*/
public class GenericTree {
- private static class Node {
+ private static final class Node {
int data;
ArrayList child = new ArrayList<>();
diff --git a/src/main/java/com/thealgorithms/datastructures/trees/TreeRandomNode.java b/src/main/java/com/thealgorithms/datastructures/trees/TreeRandomNode.java
index eeb253d9d342..b1123a224223 100644
--- a/src/main/java/com/thealgorithms/datastructures/trees/TreeRandomNode.java
+++ b/src/main/java/com/thealgorithms/datastructures/trees/TreeRandomNode.java
@@ -26,7 +26,7 @@ the inOrder() method to store the values in the arraylist, then find the size of
public class TreeRandomNode {
- private class Node {
+ private final class Node {
int item;
Node left, right;
diff --git a/src/main/java/com/thealgorithms/geometry/GrahamScan.java b/src/main/java/com/thealgorithms/geometry/GrahamScan.java
index 9122c6f6f3cc..4f4aebaed971 100644
--- a/src/main/java/com/thealgorithms/geometry/GrahamScan.java
+++ b/src/main/java/com/thealgorithms/geometry/GrahamScan.java
@@ -126,7 +126,7 @@ public Comparator polarOrder() {
return new PolarOrder();
}
- private class PolarOrder implements Comparator {
+ private final class PolarOrder implements Comparator {
public int compare(Point p1, Point p2) {
int dx1 = p1.x - x;
int dy1 = p1.y - y;
diff --git a/src/main/java/com/thealgorithms/others/RotateMatrixBy90Degrees.java b/src/main/java/com/thealgorithms/others/RotateMatrixBy90Degrees.java
index 081b0d16dce8..985b8b2631a9 100644
--- a/src/main/java/com/thealgorithms/others/RotateMatrixBy90Degrees.java
+++ b/src/main/java/com/thealgorithms/others/RotateMatrixBy90Degrees.java
@@ -6,7 +6,7 @@
*/
import java.util.Scanner;
-class Rotate_by_90_degrees {
+final class Rotate_by_90_degrees {
private Rotate_by_90_degrees() {
}