高分悬赏:编写一个JAVA程序

2024-12-25 20:40:06
推荐回答(3个)
回答1:

public abstract class Loan{

}
public class homeLoan extends Loan{
super();
public void XXX(int a,int b){
}
....//家庭贷款
}
public class carLoan extends Loan{
super();
public void XXX(int a,int b){
}
public abstract void XXX(int a,int b){
}
....//汽车
}
public interface XXX {

public void XXX(int a,int b){
}

}
public static void main(String[] args){
// 提示用户输入显示类型,可以用流式输入
carLoan car = new carLoan(); //创建汽车对象

}

回答2:

package com.zhangkai;

import java.util.Scanner;

interface Function {
public abstract void print();
}

abstract class Loan {
public abstract void show();
}

class HouseLend extends Loan implements Function {//房产贷款
private String sort;

public HouseLend() {

}

public HouseLend(String sort) {
this.sort = sort;
}

public void show() {
System.out.println();
//显示贷款多少。
}

@Override
public void print() {
//打印何种贷款

}

}
class LifeLend extends Loan implements Function {//生活贷款
private String sort;

public LifeLend() {

}

public LifeLend(String sort) {
this.sort = sort;
}

public void show() {
System.out.println();

}

@Override
public void print() {
// TODO Auto-generated method stub

}

}
class HomeExpend extends Loan implements Function {
private String sort;

public HomeExpend() {

}

public HomeExpend(String sort) {
this.sort = sort;
}

public void show() {
// TODO Auto-generated method stub

}

@Override
public void print() {
// TODO Auto-generated method stub

}

}
class CarExpend extends Loan implements Function {
private String sort;

public CarExpend() {

}

public CarExpend(String sort) {
this.sort = sort;
}

public void show() {
// TODO Auto-generated method stub

}

@Override
public void print() {
// TODO Auto-generated method stub

}

}

public class Test {
public static void main(String[] args) {
System.out.println("输入何种贷款");
Scanner scanner = new Scanner(System.in);
String str = scanner.next();
System.out.println("输入什么花费");

}
}

回答3:

太难,不会……