面向对象计算机英语,关于计算机专业面向对象编程技术的毕业设计论文英文英语外文文献翻译成品资料:面向对象的Jython(中英文双语对照).docx...

本文是中英对照毕业设计论文外文文献翻译,下载后直接可用!省去你找文献、pdf整理成word和翻译的时间!一辈子也就一次的事!

文献引用作者出处信息:Josh Juneau, Jim Baker, Victor Ng, Frank Wierzbicki, Leo Soto Mu?oz The Definitive Guide to Jython Python for the Java Platform,2020(如觉得年份太老,可改为近2年,毕竟很多毕业生都这样做)

英文3811单词,21006字符(字符就是印刷符),中文5874汉字。(如果字数多了,可自行删减,大多数学校都是要求选取外文的一部分内容进行翻译的。)

Object-Oriented Jython

This chapter is going to cover the basics of object-oriented programming. We’ll start with covering the basic reasons why you would want to write object-oriented code in the first place, and then cover all the basic syntax, and finally we’ll show you a non-trivial example.

Object-oriented programming is a method of programming where you package your code up into bundles of data and behavior. In Jython, you can define a template for this bundle with a class definition. With this first class written, you can then create instances of that class that include instance-specific data, as well as bits of code called methods that you can call to do things based on that data. This helps you organize your code into smaller, more manageable bundles.

With the release of Jython 2.5, the differences in syntax between the C version of Python and Jython are negligible. So, although everything here covers Jython, you can assume that all of the same code will run on the C implementation of Python, as well. Enough introduction though—let’s take a look at some basic syntax to see what this is all about.

Basic Syntax

Writing a class is simple. It is fundamentally about managing some kind of “state” and exposing some functions to manipulate that state. In object jargon, we call those functions “methods.”

Let’s start by creating a Car class. The goal is to create an object that will manage its own location on a two-dimensional plane. We want to be able to tell it to turn and move forward, and we want to be able to interrogate the object to find out where its current location is. Place the following code in a file named “car.py.”

We’ll go over that class def

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值