【技术翻译】Java官网教程翻译(一)——面向对象的编程概念

【背景】

   最近小编在工作中抽空学习了一些技术,但发现这些技术很多都是英文资料,鉴于小编的英文水平一般,所以开始尝试翻译英文资料,以此锻炼和提高自己的英文水平(并非权威,如有错漏,欢迎指正!不胜感激!)

【内容】

Lesson: Object-Oriented Programming Concepts

课程:面向对象的编程概念

If you’ve never used an object-oriented programming language before,
you’ll need to learn a few basic concepts before you can begin writing
any code. This lesson will introduce you to objects, classes,
inheritance, interfaces, and packages. Each discussion focuses on
how these concepts relate to the real world, while simultaneously
providing an introduction to the syntax of the Java programming
language.





如果你在此之前从来没有使用过一门面向对象编程语言,你需要在开始编编写任何代码之前学习一些基础概念。本节将会为您介绍对象、类、继承、接口和包,每一个讨论将聚焦于这些概念是如何与现实世界有关系的,与此同时提供一个对于Java编程语言的语法介绍。

What Is an Object?
An object is a software bundle of related state and behavior. Software
objects are often used to model the real-world objects that you find in
everyday life. This lesson explains how state and behavior are
represented within an object, introduces the concept of data
encapsulation, and explains the benefits of designing your software in
this manner.





什么是对象?
一个对象是状态和行为的封装。软件里的对象经常被用来对你每天在生活里发现的真实世界对象建模。本节解释了状态和行为如何在对象中表示,介绍数据封装的概念,以及解释以这种方式去设计您的软件的好处。

What Is a Class?
A class is a blueprint or prototype from whichobjects are created. This
section defines a class that models the state and behavior of a
real-world object. It intentionally focuses on the basics, showing how
even a simple class can cleanly model state and behavior.



什么是类?
类是现实世界已有的对象的一个蓝图或者说原型。本部分定义一个类来模拟真实世界对象状态和行为。它侧重于基础知识,展示了即使是简单的类也能清晰的通过状态和行为进行建模。

What Is Inheritance?
Inheritance provides a powerful and natural mechanism for organizing
and structuring your software. This section explains how classes
inherit state and behavior from their superclasses, and explains how to
derive one class from another using the simple syntax provided by the
Java programming language.




什么是继承?
继承为您的软件设计提供了强大的、自然的组织和结构。本部分解释了类如何从他们的超类继承状态和行为,并且说明了如何通过简单的Java提供的编程语法派生一个类。

What Is an Interface?
An interface is a contract between a class and the outside world.
When a class implements an interface, it promises to provide the
behavior published by that interface. This section defines a simple
interface and explains the necessary changes for any class that
implements it.




什么是接口?
接口是类和外界的契约。当类实现接口时,它被允许提供接口声明的行为。本部分定义了一个简单接口并说明了任何实现了接口的类的必要更改。

What Is a Package?
A package is a namespace for organizing classes and interfaces in a
logical manner. Placing your code into packages makes large software
projects easier to manage. This section explains why this is useful,
and introduces you to the Application Programming Interface (API)
provided by the Java platform.




什么是包?
包是一种组织类和接口的命名空间逻辑形式。将您的代码放入包里会让您的软件项目变得容易管理。本部分说明了为什么它是有用的?以及给您介绍Java平台提供的API。

Questions and Exercises:
Object-Oriented Programming Concepts Use the questions and
exercises presented in this section to test your understanding of
objects, classes, inheritance, interfaces, and packages.


问题和练习:面向对象编程概念
使用本节提出的问题和练习来测试您对于对象、类、继承、接口和包的理解。

【小结】

以上仅为小编自己翻译的第二篇Java技术文档,如有错误,欢迎评论指出。(✿◡‿◡)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章