【技術翻譯】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技術文檔,如有錯誤,歡迎評論指出。(✿◡‿◡)

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