Java SE 11 Programmer I Exam - Chapter XI Practice Questions and Answers
What's a JAR file? - Java archive file. - A JAR is a zip file with some extra information, and the extension is .jar . What is the purpose of modules? The main purpose of a module is to provide groups of related packages to offer a particular set of functionality to developers. What's JPMS? - The Java Platform Module System (JPMS) was introduced in Java 9 to group code at a higher level. - It includes the following: (1) A format for module JAR files (2) Partitioning of the JDK into modules (3) Additional command-line options for Java tools What's a module? A module is a group of one or more packages plus a special file called . How do modules help with better access control? - In addition to the regular access modifiers like private, public etc, modules can act as a fifth type of access modifier. - Modules can expose packages within the modular JAR to specific other packages. - This stronger form of encapsulation really does create internal packages. How do modules help with dependancy management? In a fully modular environment, each of the open source projects would specify their dependencies in the file. When launching the program, Java would complain that a dependancy isn't in the module path and you'd know right away. How do modules help with custom Java builds? - The Java Platform Module System allows developers to specify what modules they actually need. - This makes it possible to create a smaller runtime image that is customized to what the application needs and nothing more. - Users can run that image without having Java installed at all. - This makes runtimes shorter. How do modules help with performance? - Since Java now knows which modules are required, it only needs to look at those at class loading time. - This improves startup time for big programs and requires less memory to run. How do modules help with unique package enforcement? The Java Platform Module System ensures that a package is only allowed to be supplied by one module. What are the key rules about a module file? (1) The module-info file must be in the root directory of your module. Regular Java classes should be in packages. (2) The module-info file must use the keyword module instead of class , interface , or enum . (3) The module name follows the naming rules for package names. It often includes periods ( . ) in its name. Regular class and package names are not allowed to have dashes ( ). module ng { }
École, étude et sujet
- Établissement
- Java SE
- Cours
- Java SE
Infos sur le Document
- Publié le
- 13 juin 2024
- Nombre de pages
- 10
- Écrit en
- 2023/2024
- Type
- Examen
- Contient
- Questions et réponses
Sujets
-
java se 11 programmer i exam chapter xi practice
-
whats a jar file java archive file a jar
-
what is the purpose of modules the main purpose
Document également disponible en groupe