close
什麼叫做oo
我想,不是很重要,反正大家都在用了,只是一些 term 可能大家有誤會。
有人問過我,我也說不出來。
今天在 jEdit 的 manual 裡看到,就節錄出來看看囉。
 
An object is a collection of data that can be initialized, accessed and manipulated in certain
defined ways.
• A class is a specification of what data an object contains and what methods can be used to work
with the data. A Java application consists of one or more classes (in the case of jEdit ,over 600
classes) written by the programmer that defines the application's behavior. A BeanShell macro
uses these classes, along with built-in classes that are supplied with the Java platform, to define
its own behavior.
• A subclass (or child class) is a class which uses (or “inherits”) the data and methods of its parent
class along with additions or modifications that alter the subclass's behavior. Classes are typically
organized in hierarchies of parent and child classes to organize program code, to define common
behavior in shared parent class code, and to specify the types of similar behavior that child classes
will perform in their own specific ways.
• A method (or function) is a procedure that works with data in a particular object, other data
(including other objects) supplied as parameters, or both. Methods typically are applied to a
particular object which is an instance of the class to which the method belongs.
• A static method differs from other methods in that it does not deal with the data in a particular
object but is included within a class for the sake of convenience.
 
The keyword static we have already discussed. It means that the method does not operate on a particular object. You call a static function using the name of the class (like Macros) rather than the name of a particular object (like view). 
 
上面一大節都是英文的來自 jedit4.3pre8manual-a4 from www.jedit.org
著作權不是我的。如要引用請說明清楚,不要害我。
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 betaparticle 的頭像
    betaparticle

    betaparticle的部落格

    betaparticle 發表在 痞客邦 留言(0) 人氣()