The original link: http://zeroturnaround.com/rebellabs/reloading-objects-classes-classloaders/ A Bird's Eye View 鸟瞰 The first thing to understand when talking about reloading Java code is the relation between classes and objects. All Java code is ass…
The Original link : http://zeroturnaround.com/rebellabs/rjc301/ Copyright reserved by Rebel Inc In this article we’ll review how dynamic classloaders are used in real servers, containers and frameworks to reload Java classes and applications.  We’ll…
Before understanding metaclasses, you need to master classes in Python. And Python has a very peculiar idea of what classes are, borrowed from the Smalltalk language. 在理解元类之前,你先要掌握Python的类.Python中的类是借鉴了小众语言的特殊的类. In most languages, classes are just p…
Java中的Nested Classes和Inner Classes Java有嵌套类(Nested Classes)和内部类(Inner Classes)的概念. 嵌套类(Nested Classes)分为两种:static and non-static.即静态的和非静态的,静态的嵌套类我们称之静态嵌套类(static nested classes),非静态的嵌套类我们称之为内部类(inner classes). 静态的嵌套类我们能够这样表示: OuterClass.StaticNestedC…
http://www.javaworld.com/article/2979739/learn-java/java-101-classes-and-objects-in-java.html?page=3 class Book { // ... static int count; } This example declares a count integer field that stores the number of Book objects created. The declaration b…
The original link : http://zeroturnaround.com/rebellabs/rjc201/ From ClassLoaders to Classes 从ClassLoader到Classes If you have programmed in Java for some time you know that memory leaks do happen. Usually it’s the case of a collection somewhere with…
如果是发布到weblogic的话,可以在WebContent\WEB-INF\weblogic.xml里面配置.参考配置如下:<?xml version="1.0" encoding="UTF-8"?><weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instanc…
假设我们有个Maven的Web项目,其中有src/main/java和src/main/resources两个输出目录(注意这两个目录下的内容运行后都会输出到classes目录下), 而在src/main/java/web/Test.java这个类中要获取src/main/resources/do.txt文件通过代码怎么获取呢? 目前我个人用的是Test.class.getResource("/do.txt");,这里的Test是类名(这个类无论在src/main/java的第几层都没…
Principle To offer the benefits of encapsulation you should always expose private field with public accessor method. Correct Implementation // Encapsulation of data by accessor methods and mutators class Point { private double x; private double y; pu…
15.1 User-defined typesWe have used many of Python’s built-in types; now we are going to define a new type. As an example, we will create a type called Point that represents a point in two-dimensional space.In mathematical notation, points are often…