The Java Classloader is a part of the Java Runtime Environment that dynamically loads Java classes into the Java Virtual Machine. classes are loaded on demand in java run time environment. There is concept called delegation which is used in java class loading. Compiled java classes (.class file) are packaged in JAR files in the Java language. A class with a given name can only be loaded once by a given classloader. Each Java class must be loaded by a class loader. Furthermore, Java programs may make use of external libraries (that is, libraries written and provided by someone other than the author of the program) or they may be composed, at least in part, of a number of libraries. There are three class loaders which are responsible for Classloadng inside JVM - 1) Bootstrap class loader: The bootstrap class loader loads the core Java libraries located in the /jre/lib directory. It loads the core classes which is available in rt.jar file also called runtime jar. It is...
Class Declarations: A class declaration specifies a new named reference type. There are two kinds of class declarations: normal class declarations and enum declarations. It is a compile-time error if a class has the same simple name as any of its enclosing classes or interfaces. Class Modifiers: A class declaration may include class modifiers. The access modifier public pertains only to top level classes and member classes, not to local classes or anonymous classes. The access modifiers protected and private pertain only to member classes within a directly enclosing class declaration. The modifier static pertains only to member classes, not to top level or local or anonymous classes. It is a compile-time error if the same keyword appears more than once as a modifier for a class declaration. abstract Classes: An abstract class is a class that is incomplete, or to be considered incomplete. It is a compile-time error if an attempt is made to create an instance o...