كتابة واصفات الوحدات
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
write a module-info.java.
الموضوعات المخطط لها
- Place
module-info.javaat the source root; the module name is usually reverse-domain style. requiresdeclares a dependency;requires transitivepasses it on to users.exportsmakes a package accessible to other modules; unexported packages stay hidden even if public.exports ... tolimits to named modules.- A JAR with a descriptor on the module path is a module; unnamed or automatic modules cover legacy JARs.
تفاصيل المخطط المبدئي
عرض عملي
module com.shop.core {
requires java.sql;
exports com.shop.core.api;
}اختبر فهمك
Can another module use a public class in a non-exported package?
أظهر الإجابة
No.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.