79475212

Date: 2025-02-28 10:29:42
Score: 0.5
Natty:
Report link

Overview of Java Class Hierarchy In Java, classes are loaded by class loaders, which are responsible for dynamically loading classes into the Java Virtual Machine (JVM). The class loading hierarchy includes:

Bootstrap Class Loader: Loads the core Java classes (e.g., java.lang.Object, java.lang.String) from the rt.jar file.

Extension Class Loader: Loads classes from extension libraries (e.g., ext directory).

System Class Loader: Loads classes from the system class path (e.g., CLASSPATH environment variable).

User-defined Class Loaders: These can be custom class loaders created by applications to load classes from specific locations.

Application-Level Classes Application-level classes are those that are specific to your application and are not part of the JDK or other system libraries. These classes are typically loaded by the System Class Loader or a User-defined Class Loader.

Characteristics:

Custom: These classes are written by developers for their specific applications.

Loaded by System or Custom Class Loaders: They are loaded from the application's classpath.

Not Part of JDK: Unlike classes like java.lang.String, which are part of the JDK.

Examples:

Any custom class you write for your application (e.g., MyService, UserModel).

Third-party libraries used by your application (e.g., Spring Framework, Hibernate) if they are not part of the JDK.

Contrast with System-Level Classes System-Level Classes:

These are classes that are part of the JDK or other system libraries.

Examples include java.lang.Object, java.util.ArrayList, java.io.File.

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Amin Hosseini