انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة
الكلية كلية تكنولوجيا المعلومات
القسم قسم البرامجيات
المرحلة 2
أستاذ المادة احمد مهدي محمد سعيد الصالح
11/03/2016 07:56:46
First. Java allows certain implicit conversations of a value of one type to a value of another type. Implicit conversations involve only the primitive types. For example, Java allows chars to be widened to the numeric types. Thus, the assignment to n in the following is legal: char c=’A’; int n=c; Second, conversations involve computation, that is, they cause a production of a new type (of the variable types) that is then assigned to the variable. After the compiler determines the conversation needed to make the assignment legal, it generates the code needed to produce the new value. Overloading In some circumstances, you might want to write several method in the same class that do the same job with different arguments. If we want method to return different data types such as int, float and String types. public void println(int i) public void println ( float f) public void println ( String str) The determination of type correctness is actually not as simple as described previously, for two reasons. In addition, Java allows overloading. This means that there can be several methods with the same name. For example, consider a class C with the following methods: Public class c { static int comp( int i, long j) // def1. static float comp( long i, int j) // def 2 static int comp (long i, long j) // def3 } This class provides three overloaded definitions of comp. when there are overloaded definitions, several of them might work for a particular call. For example, suppose you have the declarations:
المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .
|