hoist for var, let, const, function, function*, class

I have been playing with ES6 for a while and I noticed that while variables declared with var are hoisted as expected… console.log(typeof name); // undefined var name = “John”; …variables declared with let or const seem to have some problems with hoisting: console.log(typeof name); // ReferenceError let name = “John”; and console.log(typeof name); //…

java synchronized on object, class and block

synchronized Blocks do have advantages over methods, most of all in flexibility because you can use other object as lock whereas syncing the method would lock the complete class. Compare: // locks the whole object … private synchronized void someInputRelatedWork() { … } private synchronized void someOutputRelatedWork() { … } Vs. // Using specific locks…

Generify class and method

To generify a class, declare the type directly after the class name: To Generify a method signature (return type), declare the class access modifier: To Generify a method parameter, declare before the parameter:

multi level css class selection

div.high>div.middle>div.low { border: 1px solid #a8a8a8; } That means “a div with a class of low, which is a child of a div with a class of middle, which is a child of a div with a class of high”. <div class=”high”> <div class=”middle”> <div class=”low”> </div> </div> </div>

Java and tomcat class loader, priority & hierarchy

Java class loader hierarchy We have 3 main class loader : Bootstrap class loader, called primordial class loader. It’s a part of the JVM., and is responsible for loading classes from the core Java package (java.lang, java.util etc.) These classes are found in JAVA_HOME/jre/lib/rt.jar. Extension class loader. It monitors the JAVA_HOME/jre/lib/ext folder and load the existing…

java OOP basic vocabularies

What is a Class? Class is a template for a set of objects that share a common structure and a common behavior. What is an Object? Object is an instance of a class. It has state,behaviour and identity. It is also called as an instance of a class. What are the core OOP’s concepts? Abstraction, Encapsulation,Inheritance…