当前位置:考试网  > 试卷库  > 计算机类  > 等级考试  > 计算机二级  > Python语言程序设计  >  请举例说明 Python 面向对象的多态性(例如函数重载、运算符重载)是如何实现的?
试题预览

请举例说明 Python 面向对象的多态性(例如函数重载、运算符重载)是如何实现的?

查看答案
收藏
纠错
正确答案:

父类和多个子类中都有同名的方法, 虽然方法同名, 但该方法在不同类中的行为是不同的。当向一个对象发送消息(即调用该方法)时,所得结果取决于是哪一个对象接收。多个不同的对象都支持相同的消息, 但各对象响应消息的行为不同,这种能力就是多态性的体现, 即同一操作在不同的上下文环境中具有不同形态的意思。

答案解析:

暂无解析

你可能感兴趣的试题

DNS实际上是一个服务器软件,运行在指定的计算机上,完成()。

假设使用一种加密算法,它的加密方法很简单:将每一个字母加5,即a加密成f。这种算法的密钥就是5,那么它属于()。

虚拟专用网一般指的是构建在Internet上能够_______的专用网络。

数字证书不包括()。

HTML文件分为文件头和文件体两部分,标记文件头的指令符号是()。

热门试题 更多>
试题分类: 初级(写作)
练习次数:6次
试题分类: 初级(口语)
练习次数:0次
Section D Even if you get work done and generally get along with co-workers, you could have habits that bug your boss (not to mention your officemates). While these quirks may not necessarily get you fired, they certainly can keep you from climbing the corporate ladder. We’ve uncovered a number of habits that bug your boss and offer tips on how to avoid them. According to LaRhonda Edwards, a human resources manager with thirteen years of HR experience, tardiness is one of the biggest concerns for managers. “If the normal work day starts at 8 o’clock, then the expectation is that you’re in the office ready to start your day,” she explains. Her advice to the chronically late? “Plan ahead,” she urges. “If you live 50 minutes away, you don’t leave 50 minutes early. Tag on extra time and anticipate road blocks.” Some people even set their clocks a few minutes early to ensure that they’re on time. Different bosses prefer different modes of communication. Lindsey Pollak, a workplace expert and author of Getting from College to Career, says if you text your boss and she prefers in-person meetings, “either your information won’t get across or you’ll irritate [her].” Fortunately, there’s a simple fix: ask your boss how and when to send updates. If you’re too shy to ask outright, then Pollak suggests observing how they communicate with you. “If you have a boss who communicates once a day by email, that’s the boss’ preferred frequency and method of communication,” explains Pollak. A cluttered, messy work space can give your boss the impression that you’re lazy or disorganized, so try to keep your desk neat. “Never put more on your desk than you’re going to work on for the day,” recommends Edwards. “At the end of the day, make sure you set up for the next day. I may be working on five things at once, but at the end of the day, they’re gone, and I set up for the next day.” Most managers would rather you ask a question than make a mistake, but many questions can be answered on your own. “Is this something you could Google or ask a colleague?” wonders Pollak. “The internet is so vast that a lot of information you can get yourself.” If you must approach your boss with a question or issue, then Pollak recommends brainstorming beforehand. “Rather than saying ‘This client is terrible. What should I do?’ think about potential solutions,” she says. Cell phones are practically ubiquitous in the workplace these days, but it’s still disruptive and disrespectful when they go off during a meeting. Edwards says that you should, “put your cell phone on vibrate or leave it in your own office so it’s not a distraction.” That way you won’t be tempted to text either ( )6.According to the article, how many pieces of advice are offered here? . A. Two B. Three C. Four D. Five(B) ( )7.What is this article about? . A. How to be successful in the workplace. B. How to communicate with your boss. C. How to avoid quirks that annoy your boss. D. How to utilize your mobile phones at work. ( )8.What does the phrase “to get across” in the sentence “…she prefers in-person meetings, “either your information won’t get across or you’ll irritate …” of the second paragraph mean? . A. To be communicated B. To be passed C. To be promoted D. To be anticipated(A) ( )9.According to the article, which of the following modes of communication is the best when communicating with your boss? . A. Any ways you think are appropriate. B. In-person meetings. C. Correspondence. D. The way your boss communicates with you.(D) ( )10.Which of the following statements is not mentioned? A. Employees should pay respect to their bosses anytime. B. Employees should plan beforehand so as to show up at work on time. C. Employees should not let their mobile phones go off during meetings. D. Employees should keep their desks neat and organized.
试题分类: 初级(阅读)
练习次数:26次
试题分类: 初级(写作)
练习次数:0次
Section C What a lovely place Xerox is to work Kim Moloney, a client services executive, can’t say enough nice things about her employer. ‘It’s a very special environment,’ she says. ‘People describe Xerox as a family and I was amazed at the number of people who have worked here for so long.’ It’s tempting to take Moloney’s comments with a pinch of salt, especially considering that when you’ve been working somewhere for only two years, as she has at Xerox, everyone seems old and established. But there’s truth behind her enthusiasm. Take Carole Palmer, the group resources director. She joined Xerox in 1978 as a temp and has been in her present role for seven years. ‘Xerox has been good to me over the years,’ she says. ‘It has supported me through qualifications … and last year I took part in the vice-president incumbent program.’ Human resources is taken seriously at Xerox, Palmer says, and the company has a policy of promoting from within (which would explain Moloney’s amazement at her colleagues’ longevity). The company takes on only fifteen to twenty graduates each year and Moloney was part of an intake who joined having already acquired a couple of years’ work experience. She started as a project manager for Xerox Global Services before moving into sales. Now her responsibility is to ‘grow and maintain customer relationships’. Moloney is based at the head office in Uxbridge. ‘It’s great in terms of working environment,’ she says. ‘We’ve just got a new provider in the canteen and … we have brainstorming rooms and breakout areas.’ Much of Moloney’s role is visiting clients, so she doesn’t have a permanent desk at head office. ‘I’m a hot-desker, which is good because you get to sit with different people in the hot-desk areas. And you’re given a place to store your things.’ Head office staff numbers between 1,200 and 1,500 people, Palmer says. The company has four other main offices in the UK. The nature of the organization, which encompasses sales and marketing, global services (the biggest division), developing markets, research and development and manufacturing, means that the opportunities at the company vary from service engineers to sales roles and consultants. Perks include a final-salary pension scheme and various discount schemes. The reward and recognition scheme is a little different, and rather nice: ‘Each manager has a budget every year to recognize and reward staff,’ Palmer says. ‘It can be in the form of a meal for two, or a bottle of wine. It can be up to £1,000. There’s the recognition, and then there’s putting money behind it.’ Moloney, however, likes the non-cash rewards. ‘Xerox takes care of all its staff but it also recognizes the people who put in the added effort,’ she says. ‘It offers once-in-a-lifetime incentive trips, and recently I organized a sailing trip for my team.’ The idea of working abroad with the company appeals to her, and she says that her career goal is to be part of the senior management team. Here’s another employee, it would seem, who is in it for the long haul. ( )1.The journalist of this article thinks that . A. staff at Xerox are not telling the truth abut the company. B. Xerox offers great benefits to staff. C. Xerox is the best company in the world. D. Xerox has the best working environment. ( )2.The company tends to find its new manager . A. only form graduates B. on training courses C. from existing staff D. from job markets ( )3.What does the phrase “to take on” in the sentence “The company takes on only fifteen to twenty graduates each year and …” of the second paragraph mean? . A. To train B. To employ C. To interview D. To maintain(A) ( )4.As well as recognizing its staff through promotion, Xerox . A. gives cash bonuses B. gives unpaid leave to take trips of a lifetime. C. provides a number of perks. D. provides huge end-of-year bonuses. ( )5.One common feature of Xerox staff is that they tend . A. to work hard B. to get promoted C. work longer hours each day D. not to change employer
试题分类: 初级(阅读)
练习次数:34次
Directions: There are ten blanks in the following passage. You are required to choose the best one from the given four choices marked A, B, C, and D. Then write down the correct answer in the brackets. This section totals 10 points, one point for each blank. Before marketing yourself globally, it is important to 1 your business is ready to deal with challenges presented by the international environment 2 language and cultural barriers, foreign laws, order fulfillment, and pre/post sales support. Language and Culture - Neither technical accuracy 3 perfect translation is sufficient when considering the language you will communicate through. It is important to really understand how a language is used by the people in your 4 market. Regional Laws - All phases of product 5 are affected by regulations. The product itself, such as its physical and chemical aspects, is subject to laws 6 to protect consumers with respect to purity, safety or performance. Product features such as packaging and warranties, advertising, sales promotion techniques are also subject to local regulations. Order Fulfillment - How will you deliver your products? What business partners will you need to ensure smooth logistics of your product? Can you handle your shipment costs? If you cannot 7 demand or ensure smooth delivery of your product, you are at risk of negatively affecting your business and its image. It is important to find and qualify 8 distributors, and pay particular attention to contract negotiation and distribution management. Pre and Post Sales Support - 9 with your customers as well as your business partners is an important consideration when marketing and selling internationally. Many businesses are able to meet customer expectations through strategic alliances or foreign distributors who deal with the local customer base on their 10 . ( )1 A. ensure B. assure C. reassure D. sure ( )2 A. excluding B. excluded C. including D. included ( )3 A. so B. nor C. and D. or ( )4 A. local B. own C. target D. home ( )5 A. sales B. exhibition C. promotion D. development ( )6 A. planned B. proposed C. supposed D. designed ( )7 A. meet B. run into C. encounter D. face ( )8 A. potent B. polite C. ethical D. potential ( )9 A. Connection B. Communication C. Link D. Contact ( )10 A. account B. part C. behalf D. market
试题分类: 初级(阅读)
练习次数:28次
扫一扫,手机做题