انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهMID-010-L02

كتابة واصفات الوحدات

  • الدرس 2 من 5
  • Mid-level
في هذا الدرس 4 موضوعات

هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

في هذا الدرس

write a module-info.java.

الموضوعات المخطط لها

  • Place module-info.java at the source root; the module name is usually reverse-domain style.
  • requires declares a dependency; requires transitive passes it on to users.
  • exports makes a package accessible to other modules; unexported packages stay hidden even if public.
  • exports ... to limits to named modules.
  • A JAR with a descriptor on the module path is a module; unnamed or automatic modules cover legacy JARs.
تفاصيل المخطط المبدئي

عرض عملي

java
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.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

المختبر والتمارين الاختبار

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.