最简单的Java,我有自行车和人类的简单代码

时间:2016-05-12 22:01:26

标签: java

Human有一个名为mName的String,它在构造函数中使用,而Bicycle有一个String mOwner,我需要将它们链接到另一个,我是新的(编程)所以我不确定我应该读什么更好理解。< / p>

我创建了findOwner方法,它返回mOwner,并声明了mName&#34; Dave&#34;在Human的构造函数中......我能以某种方式使findOwner方法返回当前Human对象的值吗?

抱歉我的英文,谢谢你)

这是我的代码:

public class Human {

    public String mName;

    public Human(String name){
        mName = name;
    }
}

/* this one is my Bicycle */

public class Hecaniv {

private String mOwner;
private int mSpeed;
private int mShift;
private int mWheels;

public Hecaniv(int shift, int speed, int wheels){
    mSpeed = speed;
    mShift = shift;
    mWheels = wheels;

}
public int currentSpeed(){
    return mSpeed;
}

public int currentShift(){
    return mShift;
}

public int numOfWheels(){
    return mWheels;
}

public String findOwner(){
    return mOwner;
}

}

1 个答案:

答案 0 :(得分:0)

您可以将所有者对象本身作为BlackPnL = np.zeros(10000000) Black_S=np.random.randint(200, 10000, 10000000)*0.01 Black_Texpiry=np.random.randint(1,500,10000000)*0.01 Black_strike=np.random.randint(1,100,10000000)*0.1 Black_volatility=np.random.rand(10000000)*1.2 Black_IR=np.random.rand(10000000)*0.1 Black_callput=np.sign(np.random.randn(10000000)) Black_callput=Black_callput.astype(np.int64) 的字段,而不是拥有所有者的名称。

Bicycle