1. Understanding Object in Java Java is a successor to a number of languages including lisp, Simula67, CLU and SmallTalk. Java is similar to C and C++ because it syntax is borrowed from them , However a deeper level it very different.
- Objects in Java contain : STATE and OPERATIONS or methods. Programs interact with objects by invoking methods. Methods provide access to manipulate objects.
- Java programs consists of classes ? Classes : – To define collections of procedures [methods] – To define new data types
Example: To define collections of procedures ? Sort an array ? Search
2. Packages
Packages: a group of classes and interfaces Purposes: 1. Encapsulation mechanism Provide a way to share info within the package while preventing its use on the outside. How? By using visibility? public, private, etc?? where public can be excess by same package and from another package. 2. Naming purpose No name conflicts between classes and interfaces defined in different packages It is possible to have same names in other packages
المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .
|