All fields

“Class Loading & Bytecode Verification” in Information Technology

35 questions across 1 technology.

Information Technology

35 questions in 1 technology

#QuestionTechnologyTopicLevel
1What is bytecode verification, and what specific categories of invalid or unsafe bytecode does the JVM's verifier reject before allowing a class to run? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationAdvanced
2How does Class Data Sharing (CDS) and Application Class Data Sharing (AppCDS) improve JVM startup time, and how does it relate to class loading and verification? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationAdvanced
3What is the parent delegation model in Java class loading, and why is it important for security and consistency? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationIntermediate
4What are the phases of class loading (loading, linking, initialization), and what specifically happens during each? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationIntermediate
5How does the Java Platform Module System (JPMS, introduced in Java 9) change class loading and encapsulation compared to the traditional classpath model? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationIntermediate
6What is the purpose of the -Xverify:none (or newer -noverify) JVM flag, and why is disabling bytecode verification generally discouraged? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationIntermediate
7How does the ServiceLoader mechanism (java.util.ServiceLoader) provide a standardized way to discover and load implementations at runtime without hardcoding class names, and how does it relate to class loading? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationIntermediate
8What is hot class reloading/redefinition (via Instrumentation.redefineClasses() or a JVM agent), and what are its practical limitations compared to a full class unload/reload? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationIntermediate
9How would you implement a custom ClassLoader to load classes from a non-standard source, such as loading plugin JARs dynamically at runtime, and what challenges arise with class unloading? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationAdvanced
10What is the role of the ClassLoader in the JVM, and what are the three built-in bootstrap/platform/application class loaders? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationBeginner
11How do you programmatically load a class by its fully-qualified name at runtime using Class.forName(), and what is a common real-world use case for this? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationBeginner
12What causes a ClassNotFoundException versus a NoClassDefFoundError, and how do you distinguish and diagnose each? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationIntermediate
13How does the same class name loaded by two different ClassLoaders create two genuinely distinct types in the JVM, and what problems does this cause (such as with singletons or ClassCastException)? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationAdvanced
14How does a thread context ClassLoader (Thread.currentThread().getContextClassLoader()) solve the problem of a core JDK class needing to load an application-provided implementation class, given parent delegation normally prevents this? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationAdvanced
15How would you diagnose and resolve a 'split package' problem when using JPMS, where the same package is defined across two different modules on the module path? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationAdvanced
16How does the compiler implement inner classes at the bytecode level, and what synthetic elements (like a hidden outer-class reference field and synthetic accessor methods) does it generate to make this work? Java › Inner Classes & Anonymous ClassesJavaInner Classes & Anonymous ClassesAdvanced
17How do lambda expressions get compiled at the bytecode level using invokedynamic, and how does this differ from how an anonymous inner class implementing the same functional interface would be compiled? Java › Functional Interfaces & Method ReferencesJavaFunctional Interfaces & Method ReferencesAdvanced
18What is the Java Platform Module System (JPMS, introduced in Java 9), and what core problem does it aim to solve compared to the traditional classpath-based approach? Java › Java Platform Module System (JPMS)JavaJava Platform Module System (JPMS)Beginner
19What is the difference between an instance initializer block and a static initializer block, and when does each execute relative to a class's constructors? Java › Java Fundamentals: Syntax, Data Types & OperatorsJavaJava Fundamentals: Syntax, Data Types & OperatorsIntermediate
20What is an automatic module, and how does placing a plain (non-modularized) JAR on the module path (rather than the classpath) differ from leaving it on the classpath as part of the unnamed module? Java › Java Platform Module System (JPMS)JavaJava Platform Module System (JPMS)Intermediate
21How does Metaspace (replacing PermGen since Java 8) store class metadata, and what specific configuration and failure modes differ from the old PermGen model? Java › Garbage CollectionJavaGarbage CollectionAdvanced
22What problem do build tools like Maven and Gradle solve for a Java project? Java › Build Tools: Maven & GradleJavaBuild Tools: Maven & GradleBeginner
23What problem do generics solve compared to using raw types (like a pre-Java-5 List without a type parameter), and how do they improve compile-time type safety? Java › GenericsJavaGenericsBeginner
24How does Gradle's build script (build.gradle / build.gradle.kts) differ structurally from Maven's declarative XML pom.xml? Java › Build Tools: Maven & GradleJavaBuild Tools: Maven & GradleIntermediate
25What is the difference between Maven's <dependencies> scope values (compile, provided, runtime, test) and how do they affect what's included in the final packaged artifact? Java › Build Tools: Maven & GradleJavaBuild Tools: Maven & GradleIntermediate
26What is type erasure, and how does it explain why generic type information is unavailable at runtime (e.g., why you can't do `if (obj instanceof List<String>)`)? Java › GenericsJavaGenericsIntermediate
27What is a raw type in Java, and why does the compiler still permit using them (with an unchecked warning) despite generics having been available since Java 5? Java › GenericsJavaGenericsIntermediate
28How does the ServiceLoader/Service Provider Interface pattern integrate with JPMS using the 'uses' and 'provides ... with' directives, replacing the older META-INF/services file-based mechanism? Java › Java Platform Module System (JPMS)JavaJava Platform Module System (JPMS)Intermediate
29How does Maven's dependency resolution algorithm handle transitive dependency version conflicts, and what is the "nearest definition wins" rule? Java › Build Tools: Maven & GradleJavaBuild Tools: Maven & GradleAdvanced
30How would you write a custom Maven plugin or Gradle task to perform project-specific build automation not covered by existing plugins? Java › Build Tools: Maven & GradleJavaBuild Tools: Maven & GradleAdvanced
31How does exception handling interact with generics and type erasure, specifically regarding why you cannot catch a generic type parameter as an exception type (catch (T e))? Java › ExceptionsJavaExceptionsAdvanced
32How does generic method overload resolution interact with type erasure to sometimes produce a compile error for seemingly valid overloads (like two methods differing only by their generic type parameter)? Java › GenericsJavaGenericsAdvanced
33How does the 'unnamed module' work, and how does JPMS maintain backward compatibility with the vast ecosystem of pre-existing JARs that were never designed with modules in mind? Java › Java Platform Module System (JPMS)JavaJava Platform Module System (JPMS)Advanced
34How would you diagnose and resolve common JPMS migration errors, such as 'package is not visible' or a split package conflict, when modularizing an existing large application? Java › Java Platform Module System (JPMS)JavaJava Platform Module System (JPMS)Advanced
35How does JPMS's strong encapsulation interact with reflection-heavy frameworks and libraries that predate the module system, and what specific JVM flags (like --add-opens) exist as an escape hatch for cases where proper module declarations aren't feasible? Java › Java Platform Module System (JPMS)JavaJava Platform Module System (JPMS)Advanced