summaryrefslogtreecommitdiffhomepage
path: root/java.html.markdown
diff options
context:
space:
mode:
authorClaudson Martins <claudson@outlook.com>2015-10-25 20:06:41 -0300
committerClaudson Martins <claudson@outlook.com>2015-10-25 20:06:41 -0300
commit71a19df2cebf1fdf46c54a500de623d821cf363b (patch)
treefaca9e30328733081efc158f587a809daa6feaff /java.html.markdown
parent27327822eb05cf1835afa2ef4365b8b4fe98b908 (diff)
parent44ca091c73afe13ec8760021cfed1d77afc5e4a5 (diff)
Merge remote-tracking branch 'refs/remotes/adambard/master'
Diffstat (limited to 'java.html.markdown')
-rw-r--r--java.html.markdown11
1 files changed, 11 insertions, 0 deletions
diff --git a/java.html.markdown b/java.html.markdown
index 38c9e490..aae64ccf 100644
--- a/java.html.markdown
+++ b/java.html.markdown
@@ -450,6 +450,17 @@ class Bicycle {
protected int gear; // Protected: Accessible from the class and subclasses
String name; // default: Only accessible from within this package
+ static String className; // Static class variable
+
+ // Static block
+ // Java has no implementation of static constructors, but
+ // has a static block that can be used to initialize class variables
+ // (static variables).
+ // This block will be called when the class is loaded.
+ static {
+ className = "Bicycle";
+ }
+
// Constructors are a way of creating classes
// This is a constructor
public Bicycle() {