シナリオ:
フォルダ: 接続
public class Connection
{
public void ServerConnect ()
{
. . . .
}
}
フォルダ: クライアント
public void Connect
{
//In here, I want to implement the method from ServerConnect
}
ServerConnect を呼び出すにはどうすればよいですか?
シナリオ:
フォルダ: 接続
public class Connection
{
public void ServerConnect ()
{
. . . .
}
}
フォルダ: クライアント
public void Connect
{
//In here, I want to implement the method from ServerConnect
}
ServerConnect を呼び出すにはどうすればよいですか?
のオブジェクトを作成し、Connection
それを呼び出しますServerConnect()
。
public void Connect{
public void Foo(){
Connection con = new Connection();
con.ServerConnect();
}
}
これがクラスを呼び出す方法です。
public void Connect
{
//In here, I want to implement the method from ServerConnect
Connection c = new Connection();
c.ServerConnect();
}
Connection クラスのオブジェクトを作成し、次のようなメソッドを呼び出すだけです
Connection obj=new Connection();
obj.ServerConnect();