انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة

Understanding Objects in Java

الكلية كلية تكنولوجيا المعلومات     القسم قسم شبكات المعلومات     المرحلة 3
أستاذ المادة مهدي عبادي مانع الموسوي       21/10/2015 02:55:04
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


المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .