⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 toy.java

📁 java代码100例子
💻 JAVA
字号:
class Toy
{ 
String toyId;
String toyName;
float toyPrice;
public Toy(String id,String name,float price)
  {
  	 toyId=id;
  	 toyName=name;
  	 toyPrice=price;
  	 
  }
  public void print()
  {
  	System.out.println("toy ID="+toyId+" name="+toyName+" price"+toyPrice);
  }
  
};
class Customer
{
String custId;
  String custName;
  String custAddress;
  float amt_outstanding;
  public Customer(String id,String name,String address)
   {
   	 custId=id;
   	 custName=name;
   	 custAddress=address;
   	 
   	    }
   	    public void print()
  {
  	System.out.println("customer ID="+custId+" name="+custName+" Address"+custAddress);
  }
   };
 class OnlineCustomer extends  Customer
{
	String loginId;
	String masterCardNo;
	public OnlineCustomer(String cId,String name,String address,String id,String cardno)
	{ 
	  super(cId,name,address);
	  loginId=id;
	  masterCardNo=cardno;
	  };
	  
	  public void print()
  {
  	System.out.println("OnlineCustomer ID="+custId+" name="+custName+" Address"+custAddress+"looginid="+loginId+"cardNO="+masterCardNo);;
  }
	 
	  public static void main(String args[])
	   { Toy toy1=new Toy("Too1","Badri Doll",40);
	   toy1.print();
	    OnlineCustomer onlineCust1=new OnlineCustomer("C001","carl","164, redmond way,ohio","caro@pixelfainies","973884833");
	   onlineCust1.print();
	   }
	 
	  }
	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -