I mean we have a class which is already loaded in JVM. and in some other method we are unknowingly trying to load that same class, So in this situation what happens? ie will there be any error or exception saying its already loaded. If not, then is it possible that we can have modified class with some extra features and load it whenever it is required that is Hot Deployment.
Share
Nothing happens. The VM first checks whether the class is loaded and loads it only if not. Otherwise it returns the already loaded class.
From
ClassLoader.loadClass(..):(You can check this article on extensive details on class loading. Although it is not directly related (as a whole) to your question, it is a good source of answers for questions like yours)