H5W3
当前位置:H5W3 > 其他技术问题 > 正文

求大佬提供完整代码?感谢感谢?

图片说明
java编写

回答

问题解决的话,请采纳,包括之前的回答。积极采纳才能详细回答,切记

import java.util.Scanner;
class Card
{
private String company;
private int money;
private int cardID;
public Card(String c, int m, int id) { conpany = c; money = m; cardID = id; }
public String toString() { return company + " " + money + " " + cardID; }
}
class BankCard extends Card
{
public BankCard(String c, int m, int id) { super(c, m, id); }
}
public class Program
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
String c = input.nextLine();
int m = input.nextInt();
int id = input.nextInt();
Card c1 = new Card(c, m, id);
System.out.println(c1);
c = input.nextLine();
m = input.nextInt();
id = input.nextInt();
BankCard c2 = new BankCard(c, m, id);
System.out.println(c2);
}
}

本文地址:H5W3 » 求大佬提供完整代码?感谢感谢?

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址