已定义类Person,该类有一个name属性,且已经通过new关键字生成了该类的一个对象p1,则访问下面对name属性的访问,正确的是()。
A.Person.name
B.p1.name
C.Person(name)
D.p1[name]
A.Person.name
B.p1.name
C.Person(name)
D.p1[name]
设计一个point(点)类: (1)该类具有成员变量x,y(表示点的横、纵坐标); (2)定义一个有参构造方法point(int x,int y),将其一对坐标值作为参数,其中x,y为给定坐标值; (3)定义一个无参的构造方法point()(令两坐标值均为0); (4)设计一个实例方法distance(point p1,point p2),实现求坐标轴上两个点的距离(Java中的开平方根函数为Math.sqrt()),其方法的声明为:double distance(point p1,point p2) 。 编写Test类,在其main方法中创建2个point对象,对应点(10,10)和点(20,25),再调用distance(point p1,point p2)方法计算出两点之间的距离并输出该值。
A.该类实例中包含__hash__()方法
B.该类没有定义任何方法,所以该实例中没有包含任何方法
C.该类实例中只包含__dir__(),不包含__hash__()
D.该类实例中包含__dir__()方法
A.the name of each person designated as a person in charge
B.the date and results of the most recent equipment inspection
C.cargoes carried and dates delivered,including destinations
D.hose information not marked on the hose