freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

計算機專業(yè)畢業(yè)設(shè)計文獻翻譯--一切都是對象-資料下載頁

2025-05-11 17:32本頁面

【導(dǎo)讀】“盡管以C++為基礎(chǔ),但Java是一種更純粹的面向?qū)ο蟪绦蛟O(shè)計語言”。但在Java中,設(shè)計者覺得這種雜合并不像在。雜合語言允許采用多種編程風(fēng)格;之所以說C++是一種雜合語言,是。因為它支持與C語言的向后兼容能力。由于C++是C的一個超集,所以包含的許多特。性都是后者不具備的,這些特性使C++在某些地方顯得過于復(fù)雜。Java語言首先便假定了我們只希望進行面向?qū)ο蟮某绦蛟O(shè)計。也就是說,正式用它。只有做好這個準(zhǔn)備工作,與其他OOP語言相比,才能體會到Java的易學(xué)易。所有這些在Java里都得到了簡化,任何東西都可看作對象。因此,我們可采用一種統(tǒng)一的語法,任何地方均可照搬不誤。但要注意,盡管將一切都?!翱醋鳌睂ο?,但操縱的標(biāo)識符實際是指向一個對象的“句柄”??蓪⑦@一情形想象成。此外,即使沒有電視機,遙控板亦可獨。也就是說,只是由于擁有一個句柄,并不表示必須有一個對象同它連接。至于調(diào)用這兩個類時可選用的構(gòu)建器和方法,請自行參考聯(lián)機幫助文檔。

  

【正文】 each of those references is automatically initialized to a special value with its own keyword: null. When Java sees null, it recognizes that the reference in question isn?t pointing to an object. You must assign an object to each reference before you use it, and if you try to use a reference that?s still null。 Thus, typical array errors are prevented in Java. 第 11 頁 You can also create an array of primitives. Again, the piler guarantees initialization because it zeroes the memory for that array. You never need to destroy an object In most programming languages, the concept of the lifetime of a variable occupies a significant portion of the programming effort. How long does the variable last? If you are supposed to destroy it, when should you? Confusion over variable lifetimes can lead to a lot of bugs, and this section shows how Java greatly simplifies the issue by doing all the cleanup work for you. Scoping Most procedural languages have the concept of scope. This determines both the visibility and lifetime of the names defined within that scope. In C, C++, and Java, scope is determined by the placement of curly braces. A variable defined within a scope is available only to the end of that scope. Any text after a ?//? to the end of a line is a ment. Indentation makes Java code easier to read. Since Java is a freeform language, the extra spaces, tabs, and carriage returns do not affect the resulting program. The piler will announce that the variable x has already been defined. Thus the C and C++ ability to “hide” a variable in a larger scope is not allowed. Scope of objects Java objects do not have the same lifetimes as primitives. When you create a Java object using new, it hangs around past the end of the scope. the references vanishes at the end of the scope. However, the String object that s was pointing to is still occupying memory. In this bit of code, there is no way to access the object, because the only reference to it is out of scope. In later chapters you?ll see how the reference to the object can be passed around and duplicated during the course of a program. It turns out that because objects created with new stay around for as long as you want them, a whole slew of C++ programming problems simply vanish in Java. The hardest problems seem to occur in C++ because you don?t get any help from the language in making sure that the objects are available when they?re needed. And more important, in C++ you must make sure that you destroy the objects when you?re done with them. 第 12 頁 That brings up an interesting question. If Java leaves the objects lying around, what keeps them from filling up memory and halting your program? This is exactly the kind of problem that would occur in C++. This is where a bit of magic happens. Java has a garbage collector, which looks at all the objects that were created with new and figures out which ones are not being referenced anymore. Then it releases the memory for those objects, so the memory can be used for new objects. This means that you never need to worry about reclaiming memory yourself. You simply create objects, and when you no longer need them, they will go away by themselves. This eliminates a certain class of programming problem: the socalled “memory leak,” in which a programmer forgets to release memory. From: Wang Rui book. C++ database system development Detailed Explanation [M].Beijing: Electronics Industry Publishing House. 2020.
點擊復(fù)制文檔內(nèi)容
畢業(yè)設(shè)計相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1