aboutsummaryrefslogtreecommitdiff
path: root/usage_examples/GetterSetterExample_post.jpage
diff options
context:
space:
mode:
Diffstat (limited to 'usage_examples/GetterSetterExample_post.jpage')
-rw-r--r--usage_examples/GetterSetterExample_post.jpage20
1 files changed, 20 insertions, 0 deletions
diff --git a/usage_examples/GetterSetterExample_post.jpage b/usage_examples/GetterSetterExample_post.jpage
new file mode 100644
index 00000000..b0921b86
--- /dev/null
+++ b/usage_examples/GetterSetterExample_post.jpage
@@ -0,0 +1,20 @@
+public class GetterSetterExample {
+ private int age = 10;
+ private String name;
+
+ @Override public String toString() {
+ return String.format("%s (age: %d)", age, name);
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+ protected void setName(String name) {
+ this.name = name;
+ }
+}