首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到19条相似文献,搜索用时 140 毫秒
1.
在Java语言中,抽象类(abstract class)和接口(interface)是支持抽象类定义的两种机制.正是由于这两种机制的存在,才赋予了Java强大的面向对对象的功能.抽象类和接口之间存在着很多相似性,但是又有本质的区别.对于初学者而言,在使用时很难界定到底采用者两种机制的哪一种.本文具体分析了这两个概念的相同点和相异处.  相似文献   

2.
曹步清  金瓯 《微机发展》2006,16(8):110-112
Abstract class和Interface是Java语言中对于抽象类定义进行支持的两种机制,正是由于这两种机制的存在,才赋予了Java强大的面向对象能力。Abstract class和Interface之间在对于抽象类定义的支持方面具有很大的相似性,因此很多开发者在进行抽象类定义时对于Abstract class和Interface的选择显得比较随意。但是,两者之间的区别还是很大的。文中从两者的定义、程序编辑、设计意图3个方面加以了比较。由此,对于它们的选择,反映出对于问题领域本质的理解和对于设计意图的理解是否正确、合理。  相似文献   

3.
Java中的Abstract Class与Interface技术研究   总被引:1,自引:0,他引:1  
Abstract class和Interface是Java语言中对于抽象类定义进行支持的两种机制,正是由于这两种机制的存在,才赋予了Java强大的面向对象能力。Abstractc lass和Interface之间在对于抽象类定义的支持方面具有很大的相似性,因此很多开发者在进行抽象类定义时对于Abstract class和Interface的选择显得比较随意。但是,两者之间的区别还是很大的。文中从两者的定义、程序编辑、设计意图3个方面加以了比较。由此,对于它们的选择,反映出对于问题领域本质的理解和对于设计意图的理解是否正确、合理。  相似文献   

4.
剖析Java语言的抽象类与接口   总被引:3,自引:0,他引:3  
抽象类和接口是Java语言中两个重要的对象引用类型,是Java程序设计使用多态性的基础。本文从两种不同的观点将其进行比较,并通过例子说明了抽象类和接口的使用场合。  相似文献   

5.
abstract class和interface是Java语言中对于抽象类定义的两种机制,它们之间在对于抽象类定义的支持方面具有很大的相似性,实际上,两者之间还是有区别的,对于它们的选择可以反映出对于问题领域本质的理解、对于设计意图的理解是否正确、合理。  相似文献   

6.
抽象类是Java中一种重要的类,合理地使用抽象类可以使程序更加简洁,复用度高。设计一个抽象类Tank,把坦克共有的属性和方法定义其中,实现了其一个具体的子类BadTank,并让其对象能够随机地自动移动。  相似文献   

7.
本文首先介绍了JavaMail API的几个关键抽象类,然后讨论了邮件系统处理邮件的机制,最后,给出了Java Mail API在邮件服务中的具体应用实例.  相似文献   

8.
接口和抽象类在使用上比较类似,但是对于其选择却又往往反映出对于问题领域中的概念本质的理解。首先对抽象类和接口的使用提出疑问,接着介绍了抽象类、接口的概念并进行理解说明和举例,最后对抽象类与接口的区别和联系进行比较和分析,对其使用的异同点进行总结,以便读者设计出更加高效、强大的了Java程序。  相似文献   

9.
Abstract Class与Interface是C#提供的两种抽象类定义机制。Abstract Class与Interface在抽象类定义方面具有很大的相似性,本文对二者的解析,为开发者提供了在它们之间进行选择的依据。  相似文献   

10.
许多面向对象语言支持抽象类机制,抽象类是一种特殊的类,因为它本身不能被实例化,所以对抽象类的基于执行的测试就比测试一般具体类更复杂。测试一般类需要该类的实例,然后调用方法执行测试用例,并分析测试结果,而测试抽象类就不能直接这样做了。论文首先分析了抽象类的故障特征,并提出了抽象类测试的改进方法。  相似文献   

11.
Fully compliant tensural bistable micromechanisms (FTBM)   总被引:1,自引:0,他引:1  
A new class of bistable mechanisms, the fully compliant tensural bistable micromechanism (FTBM) class, is introduced. The class consists of linear bistable micromechanisms that undergo tension loads, in addition to the bending loads present, through their range of motion. Proof-of-concept designs fabricated in two different microelectromechanical systems (MEMS) surface micromachining processes were demonstrated. Three sets of refined designs within the FTBM class were designed using optimization methods linked with nonlinear finite element analysis (FEA), then fabricated and tested. Measured force and displacement performance are compared to values obtained by FEA. On-chip actuation of the bistable mechanisms was achieved using thermomechanical in-plane microactuators (TIMs). The FTBM class of bistable mechanisms explores a relatively new design space for fully compliant micromechanisms, and mechanisms from this class have promise in such applications as micro shutter positioning, microvalves, and electrical microrelays. [1448].  相似文献   

12.
13.
Many entrepreneurs have recently employed crowdfunding to raise money. Although there are several crowdfunding mechanisms, there is no clear dominant strategy for the type of mechanisms that should be adopted by the entrepreneur. This paper compares two commonly used mechanisms of crowdfunding by building a two‐person and two‐period model where the entrepreneur first makes the decision then two consumers follow. The all‐or‐nothing () mechanism allows entrepreneurs to set a funding target and keep nothing unless the goal is achieved. In contrast, entrepreneurs under the keep‐it‐all () mechanism must also set a target and keep any funds regardless of whether the goal has been achieved. To compare these two mechanisms, we assume that customers are not sure about the quality of the product, which is very common in reward‐based crowdfunding. Using a unified model, our results show that large or poorly scalable projects are more likely to choose the mechanism.  相似文献   

14.
This paper analyzes judgement aggregation problems in which a group of agents independently votes on a set of complex propositions subject to an interdependency constraint. It considers the issue of judgement aggregation from the perspective of approximation; that is, it generalizes the classic framework of judgement aggregation by relaxing the two main constraints assumed in the literature, Consistency and Independence. In doing so, it also considers mechanisms that only approximately satisfy these constraints, that is, satisfy them up to a small fraction of the inputs. The main question raised is whether the relaxation of these constraints significantly alters the class of aggregation mechanisms that meet the two (relaxed) constraints. The main result of this paper is that in the case of a subclass of a natural class of aggregation problems termed “truth-functional agendas,” the set of aggregation mechanisms that meet the constraints does not extend nontrivially when the constraints are relaxed. This paper also shows connections between this new general framework and the works on approximation of preference aggregation as well as the field of Property Testing and particularly linear testing of Boolean functions.  相似文献   

15.
Oscillatory and synchronized neural activities are commonly found in the brain, and evidence suggests that many of them are caused by global feedback. Their mechanisms and roles in information processing have been discussed often using purely feedforward networks or recurrent networks with constant inputs. On the other hand, real recurrent neural networks are abundant and continually receive information-rich inputs from the outside environment or other parts of the brain. We examine how feedforward networks of spiking neurons with delayed global feedback process information about temporally changing inputs. We show that the network behavior is more synchronous as well as more correlated with and phase-locked to the stimulus when the stimulus frequency is resonant with the inherent frequency of the neuron or that of the network oscillation generated by the feedback architecture. The two eigenmodes have distinct dynamical characteristics, which are supported by numerical simulations and by analytical arguments based on frequency response and bifurcation theory. This distinction is similar to the class I versus class II classification of single neurons according to the bifurcation from quiescence to periodic firing, and the two modes depend differently on system parameters. These two mechanisms may be associated with different types of information processing.  相似文献   

16.
We study mechanism design where the objective is to maximize the residual surplus, i.e., the total value of the outcome minus the payments charged to the agents, by truthful mechanisms. The motivation comes from applications where the payments charged are not in the form of actual monetary transfers, but take the form of wasted resources. We consider a general mechanism design setting with m discrete outcomes and n multidimensional agents. We present two randomized truthful mechanisms that extract an O(logm) fraction of the maximum social surplus as residual surplus. The first mechanism achieves an O(logm)-approximation to the social surplus, which is improved to an O(1)-approximation by the second mechanism. An interesting feature of the second mechanism is that it optimizes over an appropriately restricted space of probability distributions, thus achieving an efficient tradeoff between social surplus and the total amount of payments charged to the agents.  相似文献   

17.
We study the problem of locating a single facility on a real line based on the reports of self-interested agents, when agents have double-peaked preferences, with the peaks being on opposite sides of their locations. We observe that double-peaked preferences capture real-life scenarios and thus complement the well-studied notion of single-peaked preferences. As a motivating example, assume that the government plans to build a primary school along a street; an agent with single-peaked preferences would prefer having the school built exactly next to her house. However, while that would make it very easy for her children to go to school, it would also introduce several problems, such as noise or parking congestion in the morning. A 5-min walking distance would be sufficiently far for such problems to no longer be much of a factor and at the same time sufficiently close for the school to be easily accessible by the children on foot. There are two positions (symmetrically) in each direction and those would be the agent’s two peaks of her double-peaked preference. Motivated by natural scenarios like the one described above, we mainly focus on the case where peaks are equidistant from the agents’ locations and discuss how our results extend to more general settings. We show that most of the results for single-peaked preferences do not directly apply to this setting, which makes the problem more challenging. As our main contribution, we present a simple truthful-in-expectation mechanism that achieves an approximation ratio of \(1+b/c\) for both the social and the maximum cost, where b is the distance of the agent from the peak and c is the minimum cost of an agent. For the latter case, we provide a 3 / 2 lower bound on the approximation ratio of any truthful-in-expectation mechanism. We also study deterministic mechanisms under some natural conditions, proving lower bounds and approximation guarantees. We prove that among a large class of reasonable strategyproof mechanisms, there is no deterministic mechanism that outperforms our truthful-in-expectation mechanism. In order to obtain this result, we first characterize mechanisms for two agents that satisfy two simple properties; we use the same characterization to prove that no mechanism in this class can be group-strategyproof.  相似文献   

18.
A method is presented to synthesize 5 degrees of freedom (DoFs) of 3 translational and 2 rotational (3T2R) parallel kinematic structures. This method is based on the theory of linear transformation and geometrical analysis. Central to this method is a set of novel 5 DoFs 3T2R parallel mechanisms (PMs). Based on the legs configuration, the generated mechanisms are classified. Moreover, the promising mechanisms of each class are introduced with respect to some criteria, i.e.: (a) degree of coupling between the actuators and degrees of freedom; (b) easy kinematics and control command; (c) easy construction (or low cost construction); and, (d) manufacturability. With reference to these criteria, some discussions are given on the promising mechanisms. Finally, to demonstrate the role of legs configuration in relation to the characteristics of a manipulator, the kinematic analysis of two of the introduced mechanisms is compared.  相似文献   

19.
With the dramatic growth of Internet video streaming applications, resource provisioning for video streaming systems to satisfy their upload bandwidth deficit is a challenging task. The design of incentive mechanisms for taking advantage of unused upload capability of helper peers is proven to be a viable, cost-effective solution for this problem. The existing incentive mechanisms for video streaming systems do not consider the hierarchical nature of helper-server interactions, the limited budget of server to procure the needed bandwidth, and limited information of helpers about the other parties in the system. To address these issues, we designed cooperation mechanisms for two different cases: in the full-information case where the server has the full control over the amount of payments to each helper, a Stackelberg helping game is formulated in which the server as leader determines the amount of payment for each helper and then, helpers as followers decide on their amount of contributed bandwidth accordingly. We characterize the Stackelberg Equilibrium (SE) point of game in which the server shares the benefits of bandwidth sharing with the helpers through a market mechanism. In the partial information case where the helpers’ cost and utility functions are private and unknown to the server, we propose a budget-limited reverse auction in which the helpers, in contrast to the former case, announce the lowest price at which they are willing to sell their upload bandwidth first and the server then selects a subset of the helpers and pays them proportional to their contributions. The results of extensive simulations reveal that the mechanisms are truthful and result in lower server workload and higher peers’ streaming rate and delivery ratio.  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号