ChaseDream
搜索
查看: 1400|回复: 1

英文~

[复制链接]
发表于 2020-9-26 05:44:26 | 显示全部楼层 |阅读模式
Congratulations on reaching
20th century staples

[color=rgba(0, 0, 0, 0.45)]If you stroll somewhere, you walk there in a slow, relaxed way.

  • He collected some orange juice from the refrigerator and, glass in hand, strolled to the kitchen window...

    [color=rgba(0, 0, 0, 0.45)]他从冰箱里拿了点橘子汁,然后手拿杯子溜达到厨房的窗口。

  • Afterwards, we strolled back, put the kettle on and settled down with the newspapers.

    [color=rgba(0, 0, 0, 0.45)]然后,我们溜达回来,烧上水,又坐下看报纸。



 楼主| 发表于 2020-10-6 07:49:52 | 显示全部楼层
We won't delve too deeply
An Excel sheet consists of cells. Each cell has its own unique identifier
Pascal is superior to Java.
Programming is no exception
we focus primarily on practice, which lets you progress as quickly as possible.
scratch that
Writing a program amounts to describing the various ways that objects can interact.  近乎等于
Games
Help
Subscriptions
Success stories
Chat
Forum
Articles
Friends
Messages
Activity
CodeGym

User Xi Yang
1
Teacher elly
Object interaction
Java Syntax
Level 2, Lesson 1
"Hi, Amigo. Today I'll tell you about a typical Java program. The big news is that every program written in Java consists of classes and objects."

"I already know what classes are. What are objects?"

"Let's start with an analogy. Suppose you want to build a small ship. You work on a design and then send the blueprint to a factory, where a ship will be assembled according to your design. Or a dozen ships, or as many ships as you want. My point is that dozens of identical ships can be made based on one blueprint."

"That's exactly how it works with Java."

"Java programmers are like design engineers, except instead of creating blueprints, they write classes. Ship parts are made based on blueprints, while objects are created based on classes."

"First, we write classes (make blueprints). Then, when the program is run, the Java machine creates objects based on these classes. It's exactly like how ships are built from a blueprint. One blueprint – many ships. The ships are different. They have different names and carry different cargo. But they are still similar. They all have an identical design, and are able to perform similar tasks."

"OK, I get your ship analogy. Could you give me a couple more to help me be sure I understand what you're saying?"

"Take, for example, bees..."

Object interaction - 1
"No, scratch that. I've had a bad experience with bees. Let's take ants."

"An ant colony is a good example of how objects interact. Any ant colony consists of three classes: the queen, soldiers, and worker ants. The number of ants in each class varies. Usually a colony only has one queen, dozens of soldiers, and hundreds of workers. Three classes, hundreds of objects. The ants follow strict rules as they interact with ants in their own class and ants that belong to other classes."

"This is the perfect example. A typical program works exactly like that. There is a main object that creates objects in all the classes. The objects interact with each other and with the external world. The objects' behavior is hardwired (programmed) internally."

"I don't quite get it. I mean, I don't get it at all."

"These two explanations are two sides of the same coin. The truth is somewhere in between. The first example (about blueprints and ships) shows us the connection between a class and its objects. It's a powerful analogy. The ant colony analogy demonstrates the relationship between objects, which are described by classes and exist only while a program is running."

"You mean we need to write classes for all objects used in a program, and then describe their interactions?"

"Yes, but it's easier than it sounds. In Java, while a program is running, all entities are objects. Writing a program amounts to describing the various ways that objects can interact. The objects simply call each other's methods and pass the required data to them."

"It's a little fuzzy, but I think I almost get it."
您需要登录后才可以回帖 登录 | 立即注册

Mark一下! 看一下! 顶楼主! 感谢分享! 快速回复:

所属分类: B-School生涯

近期活动

正在浏览此版块的会员 ()

手机版|ChaseDream京公网安备11010202008513号 京ICP证101109号 京ICP备12012021号

GMT+8, 2021-4-12 13:54 , Processed in 0.140401 second(s), 7 queries , Memcache On.

ChaseDream 论坛

© 2003-2021 ChaseDream.com. All Rights Reserved.

返回顶部