Hello! 欢迎来到小浪资源网!



日间封装


输入1:

朋友1类
{
字符串名称;
长移动否;
int atmPin;

public Friend1(字符串名称, 长手机号, int atmPin)
{
this.name = 名称;
this.mobileNo = mobileNo;
this.atmPin = atmPin;
}

public Static void main(String[] args)
{
Friend1 f1 = new Friend1(“Kavin”, 1234, 1111);
f1.withdraw();
}
private voidwithdraw()
{
System.out.println(atmPin);
}
公共虚空之旅()
{
System.out.println(“去兜风”);
}

公共无效publish_results()
{
System.out.println(“以好成绩通过”);
}

}

输入2:

朋友2类
{

public static void main(String[] args)
{
Friend1 ff = new Friend1(“Arul”, 3434, 2323);
ff.tour();
ff.withdraw();
}

}

输出:

日间封装

相关阅读