summaryrefslogtreecommitdiff
path: root/oop/06-static-properties/MyApp.java
diff options
context:
space:
mode:
Diffstat (limited to 'oop/06-static-properties/MyApp.java')
-rw-r--r--oop/06-static-properties/MyApp.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/oop/06-static-properties/MyApp.java b/oop/06-static-properties/MyApp.java
new file mode 100644
index 0000000..0137433
--- /dev/null
+++ b/oop/06-static-properties/MyApp.java
@@ -0,0 +1,25 @@
+
+public class MyApp {
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ System.out.println(Calculator.convertFromC2F(100.0));
+
+ Calculator.x = 5;
+
+ Calculator cal1 = new Calculator();
+ cal1.setY(10);
+ System.out.println(cal1.getXxY()); // prints 50
+
+ Calculator cal2 = new Calculator();
+ cal2.setY(11);
+
+ Calculator.x = 6;
+
+ System.out.println(cal1.getXxY()); // 60
+ System.out.println(cal2.getXxY()); // 66
+ }
+
+}