1
2
3
4
5
6
7 package com.puppycrawl.tools.checkstyle.checks.design.finalclass;
8
9 import java.util.ArrayList;
10
11 public class InputFinalClass
12 {
13 private InputFinalClass() {}
14 }
15
16 final class test2 {}
17 class test3
18 {
19 class test4
20 {
21 private test4() {}
22 }
23 }
24
25 class test5
26 {
27 private test5() {}
28 test5(int i) {}
29 }
30
31 class test6
32 {
33 public test6() {}
34 }
35
36 final class test7 {
37 private test7() {}
38 }
39
40
41
42 abstract class Operation
43 {
44 abstract double eval(double a, double b);
45
46 public static final Operation PLUS =
47 new Operation("+")
48 {
49 double eval(double a, double b)
50 {
51 return a + b;
52 }
53 };
54
55 public static final Operation MINUS =
56 new Operation("-")
57 {
58 double eval(double a, double b)
59 {
60 return a - b;
61 }
62 };
63
64 private String _name;
65 private Operation(String name)
66 {
67 this._name = name;
68 }
69 }
70
71
72
73 interface Evaluable
74 {
75 double eval(double a, double b);
76 }
77
78
79 abstract class Operation2 implements Evaluable
80 {
81
82 public static final Operation2 PLUS =
83 new Operation2("+")
84 {
85 public double eval(double a, double b)
86 {
87 return a + b;
88 }
89 };
90
91 public static final Operation2 MINUS =
92 new Operation2("-")
93 {
94 public double eval(double a, double b)
95 {
96 return a - b;
97 }
98 };
99
100 private String _name;
101 private Operation2(String name)
102 {
103 this._name = name;
104 }
105 }
106