Tutorial by Examples: clos

public class ConnectionManager { private XmppClientConnection _xmppClientConnection = null; public ConnectionManager() { if (_xmppClientConnection == null) { _xmppClientConnection = new ...
cf logs AppName --recent Note, depending on who is hosting your CF app, the size of this log may be limited.
Here, we try to explain OCP using codebase. First we'll show a scenario that violate OCP and then we'll remove that violation. Area Calculation (OCP violation Code) : public class Rectangle{ public double Width {get; set;} public double Height {get; set;} } public class Circle{ public do...
val a = Array(3) { i -> i * 2 } // creates an Array<Int> of size 3 containing [0, 2, 4]
Consider this example: He went into the cafe "Dostoevski" and said: "Good evening." Here we have two sets of quotes. Let's assume we want to match both, so that our regex matches at "Dostoevski" and "Good evening." At first, you could be tempted to keep...
Let's create a map and a closure to print hello def exMap = [:] def exClosure = { println "Hello" } Assign closure to a property in map exMap.closureProp = exClosure Calling closure exMap.closureProp.call() Output Hello Another Example - Lets create a class with ba...
it can happen that you use a scanner with the System.in as parameter for the constructor, then you need to be aware that closing the scanner will close the InputStream too giving as next that every try to read the input on that (Or any other scanner object) will throw an java.util.NoSuchElementExcep...

Page 5 of 5