summaryrefslogtreecommitdiffhomepage
path: root/java.html.markdown
diff options
context:
space:
mode:
authorRaphael Nascimento <raphaelbn10@gmail.com>2015-10-29 12:46:59 -0300
committerRaphael Nascimento <raphaelbn10@gmail.com>2015-10-29 12:46:59 -0300
commit03ef96b2f11133701a3db64b9133f634a9709e94 (patch)
treed1aed382f441d9f71e4a1cf7b9891f9fa59bd72c /java.html.markdown
parentef9331fa31ab84e5a04ee024ac490b24a6b5c4dc (diff)
[java/en] Enum Type
Diffstat (limited to 'java.html.markdown')
-rw-r--r--java.html.markdown19
1 files changed, 15 insertions, 4 deletions
diff --git a/java.html.markdown b/java.html.markdown
index 86b0578e..1813f81c 100644
--- a/java.html.markdown
+++ b/java.html.markdown
@@ -186,9 +186,9 @@ public class LearnJava {
// operations perform as could be expected for a
// doubly-linked list.
// Maps - A set of objects that map keys to values. Map is
- // an interface and therefore cannot be instantiated.
- // The type of keys and values contained in a Map must
- // be specified upon instantiation of the implementing
+ // an interface and therefore cannot be instantiated.
+ // The type of keys and values contained in a Map must
+ // be specified upon instantiation of the implementing
// class. Each key may map to only one corresponding value,
// and each key may appear only once (no duplicates).
// HashMaps - This class uses a hashtable to implement the Map
@@ -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() {
@@ -767,7 +778,7 @@ The links provided here below are just to get an understanding of the topic, fee
* [Generics](http://docs.oracle.com/javase/tutorial/java/generics/index.html)
-* [Java Code Conventions](http://www.oracle.com/technetwork/java/codeconv-138413.html)
+* [Java Code Conventions](http://www.oracle.com/technetwork/java/codeconvtoc-136057.html)
**Online Practice and Tutorials**