Links
- Testing
- Java7
- reflection
- API reference
- JavaCC / JJTree
- Covariant return types in Java
- Subtypes and Overloading in Java
- The try-with-resources Statement
- Generics
- Constructors
- stackoverflow: newCachedThreadPool() V/s newFixedThreadPool()
- Two ways that a class can implement multiple interfaces
- Java Language Specification (JLS)
- static init blocks run order
- Abstract Methods and Classes
- stackoverflow: A method local class can only refer to the local variables which are marked final
- VM options
- e.g.
XX:MaxPermSize=64m
- e.g.
- Articles
HowTo
Constructor Chaining
From: How do I call one constructor from another in Java?
- Use
this(args)
. - To call a super class, use
super(args)
. - Note that it must be the first call in the constructor.
The best way is from the smallest constructor to the largest.
public class Cons { public Cons() { this(madeUpArg1Value,madeUpArg2Value,madeUpArg3Value); } public Cons(int arg1, int arg2) { this(arg1,arg2, madeUpArg3Value); } public Cons(int arg1, int arg2, int arg3) { // Largest constructor that does the work this.arg1 = arg1; this.arg2 = arg2; this.arg3 = arg3; } }