2

I'm trying to say this in Chinese:

Inheritance allows for reuse of code where common behavior is defined once for a number of related classes and unique behavior is implemented only in classes where the behavior is different.

but this seems not very accurate:

继承允许代码的重用,一些相关联的类中共同的行为只被定义一次,具有唯一性的行为只在类之间的行为不同的地方实现。

this is a single English sentence, but it difficult to translate to Chinese anybody can help?

2
  • 1
    Kevin, I wasn't the one who downvoted you but I have a couple of suggestions: (1) Your question lacks detail, context, background which are useful in providing some help. (2) You're asking for too much in a single question. My suggestion is that you split it in several questions (There is no problem in asking many questions if they're not just spam). So try to focus on singular expressions and provide some help in what you mean to convey. :) If you have doubts/questions, you can either comment here or post a Meta question. :)
    – Alenanno
    Commented Apr 7, 2012 at 17:24
  • Can someone change the title? Its so vague to not be useful to anyone searching for this.
    – jaffa
    Commented Apr 28, 2012 at 21:44

3 Answers 3

2

The transcript is about computer science inheritance concept. And the English is written very poorly. It is not easy to understand in English, if you apply it to this kind of abstract computer science concepts nobody will understand.

Inheritance allows for reuse of code where common behavior is defined once for a number of related classes and unique behavior is implemented only in classes where the behavior is different.

继承允许代码的重用,一些相关联的类中共同的行为只被定义一次,具有唯一性的行为只在类之间的行为不同的地方实现

I don't think the marked bold one correspond to each other very much.

I think the following will be easier for you to understand.

一個類別(A)如果继承了另一類別(B),被继承的(B)為子類別,继承類別(A)則為父類別。子类继承允许代码的重用,可使子类别具有父类别的各种属性和行为,而不需要再次编写相同的代码;唯子類別之独特行为須在本身行為中個別定義。

I hope that you have the basic computer science or programming knowledge before you do this kind of translation, or it will be very difficult for you to translate the whole passage! For reference you can take chinese wikipedia of 继承_(计算机科学).

Hope that helps!

1
  • As a native English speaker, I wouldn't say that the English is "written very poorly." It's dense but clear.
    – Alf
    Commented Apr 19, 2012 at 2:11
4

继承实现了代码的重用,即相关的类的相同行为被实现一次,不同的行为被单独实现。

2
  • 2
    Hello after, and welcome to CL&U. Do you mind adding an english translation? If possible, don't limit yourself to a quick answer. Expand on it, it will become more valuable!
    – Alenanno
    Commented Apr 24, 2012 at 11:40
  • Wow, impressive translation!
    – Mengdi Gao
    Commented Apr 26, 2012 at 14:01
0

"继承"可用来重用代码, 多个相关的类中的共同行为只定义一次, 不同的行为则在这些类中分别实现.

In computer English, some words are always translated to specified Chinese character.

define -- 定义 implement -- 实现 instantiate -- 实例化

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.