Core java interview Questions You'll Most Likely Be Asked (Second Edition)


Download 1.52 Mb.
Pdf ko'rish
bet102/171
Sana07.01.2023
Hajmi1.52 Mb.
#1081886
1   ...   98   99   100   101   102   103   104   105   ...   171
Bog'liq
Core JAVA Interview Questions Youll M...

SECTION
03
CORE JAVA
JAVA 8
JAVA 9
HUMAN RESOURCE



262.





CHAPTER
01
Modules
What is a module? What benefits do they offer?
Answer:
A module consists of a group of related packages. Just like you
put a set of related classes into a package, you can put a set of
related packages into a module. Modules offer several benefits
as follows:
If an application has a large number of packages, it becomes
difficult to keep track. Modules come to the rescue, they help
to organize packages, that is related packages can be
grouped into a module.
Modules can be deployed by themselves. So, this helps to
reduce the size of an application.
Modules offer better security. Before modules, the only way to
make a class reusable in other packages was to make it
public. However, this poses a security issue since public
classes are accessible to everyone. Grouping packages into
modules ensures that the class is not accessible outside the
module.
Since there were no modules before Java 9, the Java API jar
files like rt.jar were very big in size. Instead Java 9 has split
this into smaller modules which are easier to test and
maintain.
Prior to Java 9, security was an issue as developers were
able to access internal JDK files. Modules help to overcome
this issue too. So with modules you can control which


263.
a.
b.
c.
d.
e.
f.
packages within the module are visible and accessible outside
the module.

Download 1.52 Mb.

Do'stlaringiz bilan baham:
1   ...   98   99   100   101   102   103   104   105   ...   171




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling